Web Inspector: Unable to select parent element in the DOM tree path bar
authornvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2015 22:47:39 +0000 (22:47 +0000)
committernvasilyev@apple.com <nvasilyev@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 20 Jun 2015 22:47:39 +0000 (22:47 +0000)
https://bugs.webkit.org/show_bug.cgi?id=145810

Reviewed by Timothy Hatcher.

* UserInterface/Views/DOMTreeContentView.js:
(WebInspector.DOMTreeContentView.prototype.get selectionPathComponents):
* UserInterface/Views/HierarchicalPathComponent.js:
(WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
(WebInspector.HierarchicalPathComponent.prototype._selectElementMouseUp):
(WebInspector.HierarchicalPathComponent.prototype._selectElementSelectionChanged):
(WebInspector.HierarchicalPathComponent):
(WebInspector.HierarchicalPathComponent.prototype._selectElementMouseDown): Deleted.

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

Source/WebInspectorUI/ChangeLog
Source/WebInspectorUI/UserInterface/Views/DOMTreeContentView.js
Source/WebInspectorUI/UserInterface/Views/HierarchicalPathComponent.js

index fcb2d0c..d3e1d94 100644 (file)
@@ -1,3 +1,19 @@
+2015-06-20  Nikita Vasilyev  <nvasilyev@apple.com>
+
+        Web Inspector: Unable to select parent element in the DOM tree path bar
+        https://bugs.webkit.org/show_bug.cgi?id=145810
+
+        Reviewed by Timothy Hatcher.
+
+        * UserInterface/Views/DOMTreeContentView.js:
+        (WebInspector.DOMTreeContentView.prototype.get selectionPathComponents):
+        * UserInterface/Views/HierarchicalPathComponent.js:
+        (WebInspector.HierarchicalPathComponent.prototype.get selectedPathComponent):
+        (WebInspector.HierarchicalPathComponent.prototype._selectElementMouseUp):
+        (WebInspector.HierarchicalPathComponent.prototype._selectElementSelectionChanged):
+        (WebInspector.HierarchicalPathComponent):
+        (WebInspector.HierarchicalPathComponent.prototype._selectElementMouseDown): Deleted.
+
 2015-06-19  Joseph Pecoraro  <pecoraro@apple.com>
 
         Web Inspector: Duplication of style attribute in rules panel for shadow content
index 50cf33f..c2fdf2a 100644 (file)
@@ -123,7 +123,7 @@ WebInspector.DOMTreeContentView.prototype = {
             }
 
             var pathComponent = new WebInspector.DOMTreeElementPathComponent(treeElement, treeElement.representedObject);
-            pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, this._pathComponentSelected, this);
+            pathComponent.addEventListener(WebInspector.HierarchicalPathComponent.Event.Clicked, this._pathComponentSelected, this);
             pathComponents.unshift(pathComponent);
             treeElement = treeElement.parent;
         }
index 37a20aa..52144da 100644 (file)
@@ -84,6 +84,12 @@ WebInspector.HierarchicalPathComponent = class HierarchicalPathComponent extends
 
     // Public
 
+    get selectedPathComponent()
+    {
+        var selectElement = this._selectElement[this._selectElement.selectedIndex];
+        return selectElement && selectElement._pathComponent || null;
+    }
+
     get element()
     {
         return this._element;
@@ -305,12 +311,12 @@ WebInspector.HierarchicalPathComponent = class HierarchicalPathComponent extends
 
     _selectElementMouseUp(event)
     {
-        this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.Clicked);
+        this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.Clicked, {pathComponent: this.selectedPathComponent});
     }
 
     _selectElementSelectionChanged(event)
     {
-        this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, {pathComponent: this._selectElement[this._selectElement.selectedIndex]._pathComponent});
+        this.dispatchEventToListeners(WebInspector.HierarchicalPathComponent.Event.SiblingWasSelected, {pathComponent: this.selectedPathComponent});
     }
 };