Bug 1267503 - Show the font-inspector in sidebar menu if enabled, r=jdescottes
authorAmod Narvekar <amod.narvekar@gmail.com>
Tue, 14 Jun 2016 08:12:00 +0100
changeset 301829 f2c47201a3692bc157f68e096c82468adba74720
parent 301828 0320069de38918b92e27ea489cb4ff1782d444a1
child 301830 6f305ccfd7761c4215f024de0abe264f4e994437
push id19693
push usercbook@mozilla.com
push dateWed, 15 Jun 2016 15:58:44 +0000
treeherderfx-team@6f305ccfd776 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1267503
milestone50.0a1
Bug 1267503 - Show the font-inspector in sidebar menu if enabled, r=jdescottes
devtools/client/framework/sidebar.js
devtools/client/inspector/inspector-panel.js
--- a/devtools/client/framework/sidebar.js
+++ b/devtools/client/framework/sidebar.js
@@ -139,18 +139,19 @@ ToolSidebar.prototype = {
 
     // Listening to tabs overflow event to toggle the alltabs button
     tabs.addEventListener("overflow", this._onTabBoxOverflow, false);
     tabs.addEventListener("underflow", this._onTabBoxUnderflow, false);
 
     // Add menuitems to the alltabs menu if there are already tabs in the
     // sidebar
     for (let [id, tab] of this._tabs) {
-      if (!tab.hidden) {
-        this._addItemToAllTabsMenu(id, tab, tab.hasAttribute("selected"));
+      let item = this._addItemToAllTabsMenu(id, tab, tab.hasAttribute("selected"));
+      if (tab.hidden) {
+        item.hidden = true;
       }
     }
   },
 
   removeAllTabsMenu: function () {
     if (!this._allTabsBtn) {
       return;
     }
--- a/devtools/client/inspector/inspector-panel.js
+++ b/devtools/client/inspector/inspector-panel.js
@@ -405,17 +405,17 @@ InspectorPanel.prototype = {
     this.sidebar.on("select", this._setDefaultSidebar);
 
     this.ruleview = new RuleViewTool(this, this.panelWin);
     this.computedview = new ComputedViewTool(this, this.panelWin);
 
     if (Services.prefs.getBoolPref("devtools.fontinspector.enabled") &&
         this.canGetUsedFontFaces) {
       this.fontInspector = new FontInspector(this, this.panelWin);
-      this.panelDoc.getElementById("sidebar-tab-fontinspector").hidden = false;
+      this.sidebar.toggleTab(true, "fontinspector");
     }
 
     this.layoutview = new LayoutView(this, this.panelWin);
 
     if (this.target.form.animationsActor) {
       this.sidebar.addTab("animationinspector",
                           "chrome://devtools/content/animationinspector/animation-inspector.xhtml",
                           defaultTab == "animationinspector");