Removes a use of the internal _childrenListNode property by adding
authortimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2008 22:03:21 +0000 (22:03 +0000)
committertimothy@apple.com <timothy@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 29 May 2008 22:03:21 +0000 (22:03 +0000)
        a getter/setter for smallChildren to SidebarSectionTreeElement.

        Reviewed by Adam Roben.

        * page/inspector/ResourcesPanel.js:
        (WebInspector.ResourcesPanel.prototype._toggleLargerResources):
        Toggle smallChildren on the resourcesTreeElement instead of setting
        the style class directly.
        * page/inspector/SidebarTreeElement.js:
        (WebInspector.SidebarSectionTreeElement.prototype.smallChildren):
        Sets or removes the small class on the _childrenListNode.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@34213 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebCore/ChangeLog
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/page/inspector/ResourcesPanel.js
WebCore/page/inspector/SidebarTreeElement.js

index d37bace..b4de6b7 100644 (file)
@@ -1,5 +1,20 @@
 2008-05-29  Timothy Hatcher  <timothy@apple.com>
 
+        Removes a use of the internal _childrenListNode property by adding
+        a getter/setter for smallChildren to SidebarSectionTreeElement.
+
+        Reviewed by Adam Roben.
+
+        * page/inspector/ResourcesPanel.js:
+        (WebInspector.ResourcesPanel.prototype._toggleLargerResources):
+        Toggle smallChildren on the resourcesTreeElement instead of setting
+        the style class directly.
+        * page/inspector/SidebarTreeElement.js:
+        (WebInspector.SidebarSectionTreeElement.prototype.smallChildren):
+        Sets or removes the small class on the _childrenListNode.
+
+2008-05-29  Timothy Hatcher  <timothy@apple.com>
+
         Fixes a bug where the className would be reset for Resource
         tree elements and the selected state would be lost. This could
         happen when sorting the resources.
index ae38f3a..571dfce 100644 (file)
                93EEC1F709C2877700C515D1 /* WheelEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WheelEvent.idl; sourceTree = "<group>"; };
                93EEC26E09C3218000C515D1 /* CanvasPattern.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasPattern.cpp; sourceTree = "<group>"; };
                93EEC27009C3218800C515D1 /* CanvasStyle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CanvasStyle.cpp; sourceTree = "<group>"; };
-               93F19B1908245E59001E9ABC /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+               93F19B1908245E59001E9ABC /* Info.plist */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                93F19B1A08245E5A001E9ABC /* WebCore.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = WebCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
                93F1D31A0558CC5C00821BC0 /* libicucore.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libicucore.dylib; path = /usr/lib/libicucore.dylib; sourceTree = "<absolute>"; };
                93F8B3050A300FE100F61AB8 /* CodeGenerator.pm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.perl; name = CodeGenerator.pm; path = scripts/CodeGenerator.pm; sourceTree = "<group>"; };
index 2cd35df..126d0ea 100644 (file)
@@ -1000,14 +1000,14 @@ WebInspector.ResourcesPanel.prototype = {
         if (!this.resourcesTreeElement._childrenListNode)
             return;
 
-        if (this.resourcesTreeElement._childrenListNode.hasStyleClass("small")) {
-            this.resourcesTreeElement._childrenListNode.removeStyleClass("small");
-            this.largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
-            this.largerResourcesButton.addStyleClass("toggled-on");
-        } else {
-            this.resourcesTreeElement._childrenListNode.addStyleClass("small");
+        this.resourcesTreeElement.smallChildren = !this.resourcesTreeElement.smallChildren;
+
+        if (this.resourcesTreeElement.smallChildren) {
             this.largerResourcesButton.title = WebInspector.UIString("Use large resource rows.");
             this.largerResourcesButton.removeStyleClass("toggled-on");
+        } else {
+            this.largerResourcesButton.title = WebInspector.UIString("Use small resource rows.");
+            this.largerResourcesButton.addStyleClass("toggled-on");
         }
     },
 
index 3d3ba4c..5ce1edf 100644 (file)
@@ -31,6 +31,24 @@ WebInspector.SidebarSectionTreeElement = function(title, representedObject, hasC
 WebInspector.SidebarSectionTreeElement.prototype = {
     selectable: false,
 
+    get smallChildren()
+    {
+        return this._smallChildren;
+    },
+
+    set smallChildren(x)
+    {
+        if (this._smallChildren === x)
+            return;
+
+        this._smallChildren = x;
+
+        if (this._smallChildren)
+            this._childrenListNode.addStyleClass("small");
+        else
+            this._childrenListNode.removeStyleClass("small");
+    },
+
     onattach: function()
     {
         this._listItemNode.addStyleClass("sidebar-tree-section");