Changeset 106552 in webkit
- Timestamp:
- Feb 2, 2012 6:28:39 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r106551 r106552 1 2012-02-02 Pavel Feldman <pfeldman@google.com> 2 3 Web Inspector: enable editing of selected rows on single click in elements panel. 4 https://bugs.webkit.org/show_bug.cgi?id=77627 5 6 Reviewed by Vsevolod Vlasov. 7 8 * inspector/front-end/ElementsTreeOutline.js: 9 (WebInspector.ElementsTreeElement.prototype.onattach): 10 (WebInspector.ElementsTreeElement.prototype.onselect): 11 (WebInspector.ElementsTreeElement.prototype._mouseDown): 12 * inspector/front-end/treeoutline.js: 13 (TreeElement.prototype.selectOnMouseDown): 14 (TreeElement.prototype.select): 15 1 16 2012-02-02 Philip Rogers <pdr@google.com> 2 17 -
trunk/Source/WebCore/inspector/front-end/ElementsTreeOutline.js
r105628 r106552 722 722 this._preventFollowingLinksOnDoubleClick(); 723 723 this.listItemElement.draggable = true; 724 this.listItemElement.addEventListener("click", this._mouseClick.bind(this)); 725 this.listItemElement.addEventListener("mousedown", this._mouseDown.bind(this)); 724 726 }, 725 727 … … 944 946 this.updateSelection(); 945 947 this.treeOutline.suppressRevealAndSelect = false; 948 return true; 946 949 }, 947 950 … … 993 996 if (this.hasChildren && !this.expanded) 994 997 this.expand(); 998 }, 999 1000 _mouseClick: function(event) 1001 { 1002 if (this._isSingleClickCandidate) 1003 this._startEditingTarget(event.target); 1004 this._isSingleClickCandidate = false; 1005 }, 1006 1007 _mouseDown: function(event) 1008 { 1009 if (event.handled || event.which !== 1 || this._editing || this._elementCloseTag || !this.selected) 1010 return; 1011 this._isSingleClickCandidate = true; 995 1012 }, 996 1013 -
trunk/Source/WebCore/inspector/front-end/treeoutline.js
r104553 r106552 998 998 TreeElement.prototype.selectOnMouseDown = function(event) 999 999 { 1000 this.select(false, true); 1000 if (this.select(false, true)) { 1001 event.stopPropagation(); 1002 event.preventDefault(); 1003 event.handled = true; 1004 } 1001 1005 } 1002 1006 … … 1004 1008 * @param {boolean=} omitFocus 1005 1009 * @param {boolean=} selectedByUser 1010 * @return {boolean} 1006 1011 */ 1007 1012 TreeElement.prototype.select = function(omitFocus, selectedByUser) 1008 1013 { 1009 1014 if (!this.treeOutline || !this.selectable || this.selected) 1010 return ;1015 return false; 1011 1016 1012 1017 if (this.treeOutline.selectedTreeElement) … … 1020 1025 // Focusing on another node may detach "this" from tree. 1021 1026 if (!this.treeOutline) 1022 return ;1027 return false; 1023 1028 this.treeOutline.selectedTreeElement = this; 1024 1029 if (this._listItemNode) … … 1026 1031 1027 1032 if (this.onselect) 1028 this.onselect(this, selectedByUser); 1033 return this.onselect(this, selectedByUser); 1034 return false; 1029 1035 } 1030 1036
Note: See TracChangeset
for help on using the changeset viewer.