Bug 1385270 - Fix about:telemetry subsection display r=gfritzsche
authorflyingrub <flyinggrub@gmail.com>
Wed, 09 Aug 2017 01:16:02 +0200
changeset 647021 47cf76ef4d3de84a089df659a20b7d2a7e832f48
parent 647020 fb0d8aeff611f9ede75681534cb3d3800cf4e6e1
child 647022 07b2b1b55448631484cbb388bc8e48b538bbe23f
push id74288
push userhikezoe@mozilla.com
push dateWed, 16 Aug 2017 00:19:57 +0000
reviewersgfritzsche
bugs1385270
milestone57.0a1
Bug 1385270 - Fix about:telemetry subsection display r=gfritzsche Show all subsection after comming back from another section. MozReview-Commit-ID: I02cR2IaBrm
toolkit/content/aboutTelemetry.js
--- a/toolkit/content/aboutTelemetry.js
+++ b/toolkit/content/aboutTelemetry.js
@@ -1902,22 +1902,33 @@ function show(selected) {
   let selectedValue = selected.getAttribute("value");
   if (selectedValue === "raw-json-viewer") {
     openJsonInFirefoxJsonViewer(JSON.stringify(gPingData, null, 2));
     return;
   }
 
   let current_button = document.querySelector(".category.selected");
   current_button.classList.remove("selected");
+  if (current_button.classList.contains("has-subsection")) {
+    for (let subsection of current_button.children) {
+      subsection.classList.remove("selected");
+    }
+  }
   selected.classList.add("selected");
   // Hack because subsection text appear selected. See Bug 1375114.
   document.getSelection().empty();
 
   let current_section = document.querySelector("section.active");
   let selected_section = document.getElementById(selectedValue);
+  let subsections = current_section.querySelectorAll(".sub-section");
+  if (subsections) {
+    for (let subsection of subsections) {
+      subsection.hidden = false;
+    }
+  }
   if (current_section == selected_section)
     return;
   current_section.classList.remove("active");
   selected_section.classList.add("active");
 
   let title = selected.querySelector(".category-name").textContent.trim();
   document.getElementById("sectionTitle").textContent = title;