Title: [201068] trunk/Source/WebInspectorUI
Revision
201068
Author
[email protected]
Date
2016-05-17 19:26:12 -0700 (Tue, 17 May 2016)

Log Message

Web Inspector: NavigationSidebarPanel should coordinate item selection between its tree outlines
https://bugs.webkit.org/show_bug.cgi?id=157813
<rdar://problem/26331779>

Reviewed by Timothy Hatcher.

* UserInterface/Views/DebuggerSidebarPanel.js:
(WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
Deselecting elements in other tree outlines is now done in the base class.

* UserInterface/Views/NavigationSidebarPanel.js:
(WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
Listen for selection changed events on all content tree outlines.
(WebInspector.NavigationSidebarPanel.prototype.treeElementAddedOrChanged):
Moved stub from the public section to the protected section.
(WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
Deselect tree elements in any content tree outline that is not the
parent of the selected element.

(WebInspector.NavigationSidebarPanel.prototype._treeSelectionDidChange): Deleted.
Rename _contentTreeOutlineTreeSelectionDidChange, to prevent being
shadowed by subclasses with _treeSelectionDidChange event handlers.

Modified Paths

Diff

Modified: trunk/Source/WebInspectorUI/ChangeLog (201067 => 201068)


--- trunk/Source/WebInspectorUI/ChangeLog	2016-05-18 02:14:48 UTC (rev 201067)
+++ trunk/Source/WebInspectorUI/ChangeLog	2016-05-18 02:26:12 UTC (rev 201068)
@@ -1,5 +1,30 @@
 2016-05-17  Matt Baker  <[email protected]>
 
+        Web Inspector: NavigationSidebarPanel should coordinate item selection between its tree outlines
+        https://bugs.webkit.org/show_bug.cgi?id=157813
+        <rdar://problem/26331779>
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DebuggerSidebarPanel.js:
+        (WebInspector.DebuggerSidebarPanel.prototype._treeSelectionDidChange):
+        Deselecting elements in other tree outlines is now done in the base class.
+
+        * UserInterface/Views/NavigationSidebarPanel.js:
+        (WebInspector.NavigationSidebarPanel.prototype.createContentTreeOutline):
+        Listen for selection changed events on all content tree outlines.
+        (WebInspector.NavigationSidebarPanel.prototype.treeElementAddedOrChanged):
+        Moved stub from the public section to the protected section.
+        (WebInspector.NavigationSidebarPanel.prototype._contentTreeOutlineTreeSelectionDidChange):
+        Deselect tree elements in any content tree outline that is not the
+        parent of the selected element.
+
+        (WebInspector.NavigationSidebarPanel.prototype._treeSelectionDidChange): Deleted.
+        Rename _contentTreeOutlineTreeSelectionDidChange, to prevent being
+        shadowed by subclasses with _treeSelectionDidChange event handlers.
+
+2016-05-17  Matt Baker  <[email protected]>
+
         Web Inspector: Remove TimelineSidebarPanel.js as it's no longer referenced anywhere
         https://bugs.webkit.org/show_bug.cgi?id=157819
 

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js (201067 => 201068)


--- trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-18 02:14:48 UTC (rev 201067)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/DebuggerSidebarPanel.js	2016-05-18 02:26:12 UTC (rev 201068)
@@ -692,16 +692,6 @@
         if (!treeElement)
             return;
 
-        // Deselect any other tree elements to prevent two selections in the sidebar.
-        for (let treeOutline of this.visibleContentTreeOutlines) {
-            if (treeOutline === treeElement.treeOutline)
-                continue;
-
-            let selectedTreeElement = treeOutline.selectedTreeElement;
-            if (selectedTreeElement)
-                selectedTreeElement.deselect();
-        }
-
         if (treeElement instanceof WebInspector.ResourceTreeElement || treeElement instanceof WebInspector.ScriptTreeElement) {
             WebInspector.showSourceCode(treeElement.representedObject);
             return;

Modified: trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js (201067 => 201068)


--- trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-05-18 02:14:48 UTC (rev 201067)
+++ trunk/Source/WebInspectorUI/UserInterface/Views/NavigationSidebarPanel.js	2016-05-18 02:26:12 UTC (rev 201068)
@@ -152,6 +152,7 @@
         contentTreeOutline.allowsRepeatSelection = true;
         contentTreeOutline.hidden = !dontHideByDefault;
         contentTreeOutline.element.classList.add(WebInspector.NavigationSidebarPanel.ContentTreeOutlineElementStyleClassName);
+        contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._contentTreeOutlineTreeSelectionDidChange, this);
 
         this.contentView.element.appendChild(contentTreeOutline.element);
 
@@ -159,7 +160,6 @@
             contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementAdded, this._treeElementAddedOrChanged, this);
             contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementDidChange, this._treeElementAddedOrChanged, this);
             contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.ElementDisclosureDidChanged, this._treeElementDisclosureDidChange, this);
-            contentTreeOutline.addEventListener(WebInspector.TreeOutline.Event.SelectionDidChange, this._treeSelectionDidChange, this);
         }
 
         contentTreeOutline[WebInspector.NavigationSidebarPanel.SuppressFilteringSymbol] = suppressFiltering;
@@ -428,11 +428,6 @@
         treeElement.hidden = true;
     }
 
-    treeElementAddedOrChanged(treeElement)
-    {
-        // Implemented by subclasses if needed.
-    }
-
     show()
     {
         if (!this.parentSidebar)
@@ -485,6 +480,11 @@
         }
     }
 
+    treeElementAddedOrChanged(treeElement)
+    {
+        // Implemented by subclasses if needed.
+    }
+
     // Private
 
     _updateContentOverflowShadowVisibility()
@@ -646,10 +646,22 @@
         this.soon._updateContentOverflowShadowVisibility();
     }
 
-    _treeSelectionDidChange(event)
+    _contentTreeOutlineTreeSelectionDidChange(event)
     {
-        let selectedElement = event.data.selectedElement;
-        this._selectedContentTreeOutline = selectedElement ? selectedElement.treeOutline : null;
+        let treeElement = event.data.selectedElement;
+        if (!treeElement)
+            return;
+
+        this._selectedContentTreeOutline = treeElement.treeOutline;
+
+        // Deselect any other tree elements to prevent two selections in the sidebar.
+        for (let treeOutline of this.visibleContentTreeOutlines) {
+            if (treeOutline === this._selectedContentTreeOutline)
+                continue;
+
+            if (treeOutline.selectedTreeElement)
+                treeOutline.selectedTreeElement.deselect();
+        }
     }
 
     _checkForStaleResourcesIfNeeded()
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to