Bug 1437890 - Move Layout before Computed in Inspector. r=gl
MozReview-Commit-ID: 8hUoqh0LlQQ
--- a/devtools/client/inspector/inspector.js
+++ b/devtools/client/inspector/inspector.js
@@ -703,20 +703,24 @@ Inspector.prototype = {
if (this.isSplitRuleViewEnabled && defaultTab === "ruleview") {
defaultTab = "computedview";
}
// Append all side panels
await this.addRuleView(defaultTab);
- this.sidebar.addExistingTab(
- "computedview",
- INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
- defaultTab == "computedview");
+ // If the 3 Pane Inspector feature is disabled, use the old order:
+ // Rules, Computed, Layout, etc.
+ if (!Services.prefs.getBoolPref("devtools.inspector.split-sidebar-toggle")) {
+ this.sidebar.addExistingTab(
+ "computedview",
+ INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
+ defaultTab == "computedview");
+ }
// Inject a lazy loaded react tab by exposing a fake React object
// with a lazy defined Tab thanks to `panel` being a function
let layoutId = "layoutview";
let layoutTitle = INSPECTOR_L10N.getStr("inspector.sidebar.layoutViewTitle2");
this.sidebar.addTab(
layoutId,
layoutTitle,
@@ -732,16 +736,25 @@ Inspector.prototype = {
this.layoutview = new LayoutView(this, this.panelWin);
}
return this.layoutview.provider;
}
},
defaultTab == layoutId);
+ // If the 3 Pane Inspector feature is enabled, use the new order:
+ // Rules, Layout, Computed, etc.
+ if (Services.prefs.getBoolPref("devtools.inspector.split-sidebar-toggle")) {
+ this.sidebar.addExistingTab(
+ "computedview",
+ INSPECTOR_L10N.getStr("inspector.sidebar.computedViewTitle"),
+ defaultTab == "computedview");
+ }
+
if (Services.prefs.getBoolPref("devtools.changesview.enabled")) {
// Inject a lazy loaded react tab by exposing a fake React object
// with a lazy defined Tab thanks to `panel` being a function
let changesId = "changesview";
let changesTitle = INSPECTOR_L10N.getStr("inspector.sidebar.changesViewTitle");
this.sidebar.addTab(
changesId,
changesTitle,