Bug 1566358 - Update releases page to include 64-bit Windows and Linux platforms - update JS to use data-title attribute for download titles r=me
authorIan Neal <iann_cvs@blueyonder.co.uk>
Mon, 22 Jul 2019 11:59:00 +0100
changeset 1356 f43cf008a42fe7729adb001045e41f45a467dddc
parent 1355 461d74724705a068eea9500d5dad1b116840c4d5
child 1357 3f0c7f3d09b3503237d9e0f483e24e980ff82be3
push id130
push useriann_cvs@blueyonder.co.uk
push dateMon, 22 Jul 2019 11:00:25 +0000
reviewersme
bugs1566358
Bug 1566358 - Update releases page to include 64-bit Windows and Linux platforms - update JS to use data-title attribute for download titles r=me
src/download2.jst
--- a/src/download2.jst
+++ b/src/download2.jst
@@ -73,18 +73,19 @@ function generateDownloadURL()
   var platform = getOptionSelected("download_platform");
   var language = getOptionSelected("download_language");
   var url = document.getElementById(language.id)
                     .querySelector('td > a[data-platform="' + platform.id + '"]');
   if (url) {
     // Update href, title and other attributes of download link.
     var link = document.getElementById("download_link");
     link.href = url.href;
-    link.title = url.title.replace("%platform", platform.label)
-                          .replace("%language", language.label);
+    link.title = link.getAttribute("data-title")
+                     .replace("%platform", platform.label)
+                     .replace("%language", language.label);
     link.setAttribute("data-platform", platform.id);
     link.setAttribute("data-language", language.id);
     document.getElementById("download_icon").className = url.className;
 
     // Set platform and language in download_info div.
     document.getElementById("info_platform").textContent = platform.label;
     document.getElementById("info_language").textContent = language.label;
   }