Changeset 156672 in webkit
- Timestamp:
- Sep 30, 2013 1:06:06 PM (11 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r156520 r156672 1 2013-09-30 Antoine Quint <graouts@apple.com> 2 3 Web Inspector: nodes can be dragged from the console log 4 https://bugs.webkit.org/show_bug.cgi?id=122105 5 6 Reviewed by Darin Adler. 7 8 Catch "dragstart" events targeting nodes hosted in a DOMTreeOutline within the console 9 log view and prevent the default logic to trigger so that these nodes can't be dragged 10 off the console as it wouldn't make sense to. 11 12 * UserInterface/DOMTreeOutline.js: 13 (WebInspector.DOMTreeOutline): 14 Create a class property to allow the CSS class name to be used in WebInspector.LogContentView. 15 16 * UserInterface/LogContentView.js: 17 (WebInspector.LogContentView): 18 (WebInspector.LogContentView.prototype._ondragstart): 19 Track the "dragstart" events in their capture phase such that, if the event target is 20 a DOM node hosted in a DOMTreeOutline, we can prevent the event from propagating and 21 cancel its default behavior such that no dragging at all is performed. 22 1 23 2013-09-26 Brian J. Burg <burg@cs.washington.edu> 2 24 -
trunk/Source/WebInspectorUI/UserInterface/DOMTreeOutline.js
r151453 r156672 47 47 this.element.addEventListener("dragend", this._ondragend.bind(this), false); 48 48 49 this.element.classList.add( "dom-tree-outline");49 this.element.classList.add(WebInspector.DOMTreeOutline.StyleClassName); 50 50 this.element.classList.add(WebInspector.SyntaxHighlightedStyleClassName); 51 51 … … 71 71 72 72 WebInspector.Object.addConstructorFunctions(WebInspector.DOMTreeOutline); 73 74 WebInspector.DOMTreeOutline.StyleClassName = "dom-tree-outline"; 73 75 74 76 WebInspector.DOMTreeOutline.Event = { -
trunk/Source/WebInspectorUI/UserInterface/LogContentView.js
r156198 r156672 42 42 this.messagesElement.addEventListener("keydown", this._keyDown.bind(this)); 43 43 this.messagesElement.addEventListener("click", this._click.bind(this), true); 44 this.messagesElement.addEventListener("dragstart", this._ondragstart.bind(this), true); 44 45 this.element.appendChild(this.messagesElement); 45 46 … … 432 433 event.stopPropagation(); 433 434 delete this._mouseInteractionShouldPreventClickPropagation; 435 }, 436 437 _ondragstart: function(event) 438 { 439 if (event.target.enclosingNodeOrSelfWithClass(WebInspector.DOMTreeOutline.StyleClassName)) { 440 event.stopPropagation(); 441 event.preventDefault(); 442 } 434 443 }, 435 444
Note: See TracChangeset
for help on using the changeset viewer.