diff options
Diffstat (limited to 'Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js')
-rw-r--r-- | Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js b/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js index d3190a9..bdbb0cf 100644 --- a/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js +++ b/Source/WebCore/inspector/front-end/ScopeChainSidebarPane.js @@ -26,6 +26,8 @@ WebInspector.ScopeChainSidebarPane = function() { WebInspector.SidebarPane.call(this, WebInspector.UIString("Scope Variables")); + this._sections = []; + this._expandedSections = {}; this._expandedProperties = []; } @@ -34,9 +36,6 @@ WebInspector.ScopeChainSidebarPane.prototype = { { this.bodyElement.removeChildren(); - this.sections = []; - this.callFrame = callFrame; - if (!callFrame) { var infoElement = document.createElement("div"); infoElement.className = "info"; @@ -45,6 +44,18 @@ WebInspector.ScopeChainSidebarPane.prototype = { return; } + for (var i = 0; i < this._sections.length; ++i) { + var section = this._sections[i]; + if (!section.title) + continue; + if (section.expanded) + this._expandedSections[section.title] = true; + else + delete this._expandedSections[section.title]; + } + + this._sections = []; + var foundLocalScope = false; var scopeChain = callFrame.scopeChain; for (var i = 0; i < scopeChain.length; ++i) { @@ -81,10 +92,10 @@ WebInspector.ScopeChainSidebarPane.prototype = { section.editInSelectedCallFrameWhenPaused = true; section.pane = this; - if (!foundLocalScope || scopeObjectProxy.isLocal) + if (!foundLocalScope || scopeObjectProxy.isLocal || title in this._expandedSections) section.expanded = true; - this.sections.push(section); + this._sections.push(section); this.bodyElement.appendChild(section.element); } } |