Bug 1345997 - Add a check for the inspector toolbox when checking if the grid inspector or box model is visible. r?jdescottes
MozReview-Commit-ID: 5Ve2COO5Vkc
--- a/devtools/client/inspector/boxmodel/box-model.js
+++ b/devtools/client/inspector/boxmodel/box-model.js
@@ -73,18 +73,18 @@ BoxModel.prototype = {
onShowBoxModelHighlighter: this.onShowBoxModelHighlighter,
};
},
/**
* Returns true if the computed or layout panel is visible, and false otherwise.
*/
isPanelVisible() {
- return this.inspector.toolbox.currentToolId === "inspector" &&
- this.inspector.sidebar &&
+ return this.inspector.toolbox && this.inspector.sidebar &&
+ this.inspector.toolbox.currentToolId === "inspector" &&
(this.inspector.sidebar.getCurrentTabID() === "layoutview" ||
this.inspector.sidebar.getCurrentTabID() === "computedview");
},
/**
* Returns true if the layout panel is visible and the current node is valid to
* be displayed in the view.
*/
--- a/devtools/client/inspector/grids/grid-inspector.js
+++ b/devtools/client/inspector/grids/grid-inspector.js
@@ -169,18 +169,18 @@ GridInspector.prototype = {
getSwatchColorPickerTooltip() {
return this.swatchColorPickerTooltip;
},
/**
* Returns true if the layout panel is visible, and false otherwise.
*/
isPanelVisible() {
- return this.inspector.toolbox.currentToolId === "inspector" &&
- this.inspector.sidebar &&
+ return this.inspector.toolbox && this.inspector.sidebar &&
+ this.inspector.toolbox.currentToolId === "inspector" &&
this.inspector.sidebar.getCurrentTabID() === "layoutview";
},
/**
* Load the grid highligher display settings into the store from the stored preferences.
*/
loadHighlighterSettings() {
let { dispatch } = this.store;