Bug 1437880 -Disable "Remove Selected" button in the site data manager dialog if a website is deselected. r?prathiksha draft
authoraccakks <aakanksha.jain8@gmail.com>
Fri, 23 Mar 2018 20:04:34 +0530
changeset 772165 f5707a68e679debf240554ccfa2c87629bb7e868
parent 772164 8a4bb920ffab7e8d1e599c0b26d748e39021e2f4
push id103865
push userbmo:aakanksha.jain8@gmail.com
push dateSun, 25 Mar 2018 09:03:27 +0000
reviewersprathiksha
bugs1437880
milestone61.0a1
Bug 1437880 -Disable "Remove Selected" button in the site data manager dialog if a website is deselected. r?prathiksha MozReview-Commit-ID: 143V5T5m6ta
browser/components/preferences/siteDataSettings.js
toolkit/content/aboutTelemetry.js
--- a/browser/components/preferences/siteDataSettings.js
+++ b/browser/components/preferences/siteDataSettings.js
@@ -258,16 +258,17 @@ let gSiteDataSettings = {
 
   close() {
     window.close();
   },
 
   onClickTreeCol(e) {
     this._sortSites(this._sites, e.target);
     this._buildSitesList(this._sites);
+    this._list.clearSelection();
   },
 
   onCommandSearch() {
     this._buildSitesList(this._sites);
     this._list.clearSelection();
   },
 
   onClickRemoveSelected() {
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -215,30 +215,35 @@ var Settings = {
   /**
    * Updates the button & text at the top of the page to reflect Telemetry state.
    */
   render() {
     let settingsExplanation = document.getElementById("settings-explanation");
     let uploadEnabled = this.getStatusStringForSetting(this.SETTINGS[0]);
     let extendedEnabled = Services.telemetry.canRecordExtended;
     let collectedData = bundle.GetStringFromName(extendedEnabled ? "prereleaseData" : "releaseData");
-
     let parameters = [
       collectedData,
       this.convertStringToLink(uploadEnabled),
     ];
-    let explanation = bundle.formatStringFromName("settingsExplanation", parameters, 2);
+    let explanation = BrowserUtils.getLocalizedFragment(doc, "settingsExplanation", parameters);
 
     // eslint-disable-next-line no-unsanitized/property
-    settingsExplanation.innerHTML = explanation;
+    settingsExplanation.appendChild(explanation);
     this.attachObservers();
   },
 
   convertStringToLink(string) {
-    return "<a href=\"#\" class=\"change-data-choices-link\">" + string + "</a>";
+    let uploadEnabled = document.createElement('a');
+    uploadEnabled.className = "change-data-choices-link";
+    let uploadEnabledContent = document.createTextNode(string);
+    return uploadEnabled.appendChild(uploadEnabledContent);
+
+
+
   },
 };
 
 var PingPicker = {
   viewCurrentPingData: null,
   _archivedPings: null,
   TYPE_ALL: bundle.GetStringFromName("telemetryPingTypeAll"),