Web Inspector: Remove SidebarPanel show/hide and added/removed
authormattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Sep 2017 00:55:23 +0000 (00:55 +0000)
committermattbaker@apple.com <mattbaker@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 23 Sep 2017 00:55:23 +0000 (00:55 +0000)
https://bugs.webkit.org/show_bug.cgi?id=177387

Reviewed by Devin Rousso.

* UserInterface/Views/DebuggerTabContentView.js:
(WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
* UserInterface/Views/SearchSidebarPanel.js:
(WI.SearchSidebarPanel.prototype.focusSearchField):
* UserInterface/Views/Sidebar.js:
(WI.Sidebar.prototype.insertSidebarPanel):
(WI.Sidebar.prototype.removeSidebarPanel):
* UserInterface/Views/SidebarPanel.js:
(WI.SidebarPanel.prototype.show): Deleted.
(WI.SidebarPanel.prototype.hide): Deleted.
(WI.SidebarPanel.prototype.added): Deleted.
(WI.SidebarPanel.prototype.removed): Deleted.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DebuggerTabContentView.js
Source/WebInspectorUI/UserInterface/Views/SearchSidebarPanel.js
Source/WebInspectorUI/UserInterface/Views/Sidebar.js
Source/WebInspectorUI/UserInterface/Views/SidebarPanel.js

index 3084aae..e8a340a 100644 (file)
@@ -1,5 +1,25 @@
 2017-09-22  Matt Baker  <mattbaker@apple.com>
 
+        Web Inspector: Remove SidebarPanel show/hide and added/removed
+        https://bugs.webkit.org/show_bug.cgi?id=177387
+
+        Reviewed by Devin Rousso.
+
+        * UserInterface/Views/DebuggerTabContentView.js:
+        (WI.DebuggerTabContentView.prototype.showDetailsSidebarPanels):
+        * UserInterface/Views/SearchSidebarPanel.js:
+        (WI.SearchSidebarPanel.prototype.focusSearchField):
+        * UserInterface/Views/Sidebar.js:
+        (WI.Sidebar.prototype.insertSidebarPanel):
+        (WI.Sidebar.prototype.removeSidebarPanel):
+        * UserInterface/Views/SidebarPanel.js:
+        (WI.SidebarPanel.prototype.show): Deleted.
+        (WI.SidebarPanel.prototype.hide): Deleted.
+        (WI.SidebarPanel.prototype.added): Deleted.
+        (WI.SidebarPanel.prototype.removed): Deleted.
+
+2017-09-22  Matt Baker  <mattbaker@apple.com>
+
         Web Inspector: View should automatically layout when it becomes attached to the DOM
         https://bugs.webkit.org/show_bug.cgi?id=177189
 
index 1c4eba0..5e7f126 100644 (file)
@@ -73,10 +73,12 @@ WI.DebuggerTabContentView = class DebuggerTabContentView extends WI.ContentBrows
             return;
 
         let scopeChainDetailsSidebarPanel = WI.instanceForClass(WI.ScopeChainDetailsSidebarPanel);
-        if (!scopeChainDetailsSidebarPanel.parentSidebar)
+        let sidebar = scopeChainDetailsSidebarPanel.parentSidebar;
+        if (!sidebar)
             return;
 
-        scopeChainDetailsSidebarPanel.show();
+        sidebar.selectedSidebarPanel = scopeChainDetailsSidebarPanel;
+        sidebar.collapsed = false;
 
         this._showScopeChainDetailsSidebarPanel = false;
     }
index 195af9f..0635916 100644 (file)
@@ -64,7 +64,11 @@ WI.SearchSidebarPanel = class SearchSidebarPanel extends WI.NavigationSidebarPan
 
     focusSearchField(performSearch)
     {
-        this.show();
+        if (!this.parentSidebar)
+            return;
+
+        this.parentSidebar.selectedSidebarPanel = this;
+        this.parentSidebar.collapsed = false;
 
         this._inputElement.select();
 
index 62431d8..10115b5 100644 (file)
@@ -85,8 +85,6 @@ WI.Sidebar = class Sidebar extends WI.View
             console.assert(sidebarPanel.navigationItem);
             this._navigationBar.insertNavigationItem(sidebarPanel.navigationItem, index);
         }
-
-        sidebarPanel.added();
     }
 
     removeSidebarPanel(sidebarPanelOrIdentifierOrIndex)
@@ -114,8 +112,6 @@ WI.Sidebar = class Sidebar extends WI.View
             console.assert(sidebarPanel.navigationItem);
             this._navigationBar.removeNavigationItem(sidebarPanel.navigationItem);
         }
-
-        sidebarPanel.removed();
     }
 
     get selectedSidebarPanel()
index 821f632..8608c1c 100644 (file)
@@ -92,38 +92,6 @@ WI.SidebarPanel = class SidebarPanel extends WI.View
         return 0;
     }
 
-    show()
-    {
-        if (!this.parentSidebar)
-            return;
-
-        this.parentSidebar.collapsed = false;
-        this.parentSidebar.selectedSidebarPanel = this;
-    }
-
-    hide()
-    {
-        if (!this.parentSidebar)
-            return;
-
-        this.parentSidebar.collapsed = true;
-        this.parentSidebar.selectedSidebarPanel = null;
-    }
-
-    added()
-    {
-        console.assert(this.parentSidebar);
-
-        // Implemented by subclasses.
-    }
-
-    removed()
-    {
-        console.assert(!this.parentSidebar);
-
-        // Implemented by subclasses.
-    }
-
     shown()
     {
         this._contentView.element.scrollTop = this._savedScrollPosition;