Skip to content
Permalink
Browse files
2011-01-27 Pavel Podivilov <podivilov@chromium.org>
        Reviewed by Pavel Feldman.

        Web Inspector: Closure and Global variable details automatically collapsing on each step through JavaScript code.
        https://bugs.webkit.org/show_bug.cgi?id=53234

        * inspector/front-end/ScopeChainSidebarPane.js:
        (WebInspector.ScopeChainSidebarPane):
        (WebInspector.ScopeChainSidebarPane.prototype.update):

Canonical link: https://commits.webkit.org/67007@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@76789 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
Pavel Podivilov committed Jan 27, 2011
1 parent 30e056f commit 3f9797a2e78e1cf603f6eedc5cac5e3f0b81634e
Showing 2 changed files with 27 additions and 5 deletions.
@@ -1,3 +1,14 @@
2011-01-27 Pavel Podivilov <podivilov@chromium.org>

Reviewed by Pavel Feldman.

Web Inspector: Closure and Global variable details automatically collapsing on each step through JavaScript code.
https://bugs.webkit.org/show_bug.cgi?id=53234

* inspector/front-end/ScopeChainSidebarPane.js:
(WebInspector.ScopeChainSidebarPane):
(WebInspector.ScopeChainSidebarPane.prototype.update):

2011-01-27 Alexander Pavlov <apavlov@chromium.org>

Reviewed by Pavel Feldman.
@@ -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);
}
}

0 comments on commit 3f9797a

Please sign in to comment.