| Index: Source/devtools/front_end/ElementsPanel.js
|
| diff --git a/Source/devtools/front_end/ElementsPanel.js b/Source/devtools/front_end/ElementsPanel.js
|
| index 8f66a85f372ea8123eb8d13c98caa3a11dbd1872..ea1745d9a023d254c9999f3945fd9b25cc4d2396 100644
|
| --- a/Source/devtools/front_end/ElementsPanel.js
|
| +++ b/Source/devtools/front_end/ElementsPanel.js
|
| @@ -119,9 +119,6 @@ WebInspector.ElementsPanel = function()
|
| WebInspector.domAgent.addEventListener(WebInspector.DOMAgent.Events.DocumentUpdated, this._documentUpdatedEvent, this);
|
| WebInspector.settings.showShadowDOM.addChangeListener(this._showShadowDOMChanged.bind(this));
|
|
|
| - if (WebInspector.domAgent.existingDocument())
|
| - this._documentUpdated(WebInspector.domAgent.existingDocument());
|
| -
|
| WebInspector.cssModel.addEventListener(WebInspector.CSSStyleModel.Events.ModelWasEnabled, this._updateSidebars, this);
|
| }
|
|
|
| @@ -168,7 +165,10 @@ WebInspector.ElementsPanel.prototype = {
|
| this.treeOutline.setVisible(true);
|
|
|
| if (!this.treeOutline.rootDOMNode)
|
| - WebInspector.domAgent.requestDocument();
|
| + if (WebInspector.domAgent.existingDocument())
|
| + this._documentUpdated(WebInspector.domAgent.existingDocument());
|
| + else
|
| + WebInspector.domAgent.requestDocument();
|
| },
|
|
|
| willHide: function()
|
| @@ -188,6 +188,16 @@ WebInspector.ElementsPanel.prototype = {
|
| this._updateTreeOutlineVisibleWidth();
|
| },
|
|
|
| + omitDefaultSelection: function()
|
| + {
|
| + this._omitDefaultSelection = true;
|
| + },
|
| +
|
| + stopOmittingDefaultSelection: function()
|
| + {
|
| + delete this._omitDefaultSelection;
|
| + },
|
| +
|
| /**
|
| * @param {!DOMAgent.NodeId} nodeId
|
| * @param {string} pseudoClass
|
| @@ -312,6 +322,9 @@ WebInspector.ElementsPanel.prototype = {
|
| selectNode.call(this, node);
|
| }
|
|
|
| + if (this._omitDefaultSelection)
|
| + return;
|
| +
|
| if (this._selectedPathOnReset)
|
| WebInspector.domAgent.pushNodeByPathToFrontend(this._selectedPathOnReset, selectLastSelectedNode.bind(this));
|
| else
|
| @@ -1351,6 +1364,6 @@ WebInspector.ElementsPanel.DOMNodeRevealer.prototype = {
|
| reveal: function(node)
|
| {
|
| if (node instanceof WebInspector.DOMNode)
|
| - /** @type {!WebInspector.ElementsPanel} */ (WebInspector.showPanel("elements")).revealAndSelectNode(node.id);
|
| + /** @type {!WebInspector.ElementsPanel} */ (WebInspector.panel("elements")).revealAndSelectNode(node.id);
|
| }
|
| }
|
|
|