Bug 734013 - Implement the pane-switching functionality for the in-content preferences. r=bmcbride
authorOwen Carpenter <owenccarpenter@gmail.com>
Tue, 08 May 2012 19:13:05 -0700
changeset 93573 4d02fc5fc5c3e97bafbf034b9b6e77eef8f9d060
parent 93572 b2d23fc61c6f0d6f5e41ba796518eb29ab720c7e
child 93574 c9262b622112c8f9cb4165c64aa7789040914dec
push id9210
push userjwein@mozilla.com
push dateWed, 09 May 2012 05:35:43 +0000
treeherdermozilla-inbound@8b195889f55c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbmcbride
bugs734013
milestone15.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 734013 - Implement the pane-switching functionality for the in-content preferences. r=bmcbride
browser/components/preferences/in-content/preferences.js
browser/components/preferences/in-content/preferences.xul
--- a/browser/components/preferences/in-content/preferences.js
+++ b/browser/components/preferences/in-content/preferences.js
@@ -18,16 +18,17 @@ function init_all() {
   window.addEventListener("popstate", onStatePopped, true);
   updateCommands();
   var initFinished = document.createEvent("Event");
   initFinished.initEvent("Initialized", true, true);
   document.dispatchEvent(initFinished);
 }
 
 function gotoPref(page) {
+  search(page, "data-category");
   window.history.pushState(page, document.title);
   updateCommands();
 }
  
 function cmd_back() {
   window.history.back();
 }
  
@@ -51,8 +52,16 @@ function canGoBack() {
                .canGoBack;
 }
 
 function canGoForward() {
   return window.QueryInterface(Ci.nsIInterfaceRequestor)
                .getInterface(Ci.nsIWebNavigation)
                .canGoForward;
 }
+
+function search(aQuery, aAttribute) {
+  let elements = document.getElementById("mainPrefPane").children;
+  for (let element of elements) {
+    let attributeValue = element.getAttribute(aAttribute);
+    element.hidden = (attributeValue != aQuery);
+  }
+}
--- a/browser/components/preferences/in-content/preferences.xul
+++ b/browser/components/preferences/in-content/preferences.xul
@@ -83,14 +83,14 @@
                    oncommand="cmd_back()" tooltiptext="&buttonBack.tooltip;"
                    disabled="true"/>
     <toolbarbutton id="forward-btn" class="nav-button header-button"
                    oncommand="cmd_forward()" tooltiptext="&buttonForward.tooltip;"
                    disabled="true"/>
   </hbox>
   
   <hbox class="main-content" flex="1">
-    <prefpane flex="1">
+    <prefpane flex="1" id="mainPrefPane">
 #include landing.xul
     </prefpane>
   </hbox>
   
 </page>