Changeset 51119 in webkit
- Timestamp:
- Nov 18, 2009 10:12:07 AM (14 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r51118 r51119 1 2009-11-17 Brian Weinstein <bweinstein@apple.com> 2 3 Reviewed by Pavel Feldman. 4 5 Fixes <http://webkit.org/b/31606>. 6 Web Inspector: Enter/Return key should enter edit mode for Editable Fields. 7 8 This implements Enter starting editing mode in an editable DataGrid. If the 9 DataGrid is editable and the user hits return, startEditing the first child 10 of the selected node. Also refactored some editing functions to take an 11 event target instead of the event itself, because the functions only needed 12 the target. Lastly, added had return in editing mode stop propogation, because 13 when enter was hit to confirm text, it would propagate back to the datagrid 14 and try to start editing again. 15 16 * inspector/front-end/DataGrid.js: 17 (WebInspector.DataGrid.prototype._ondblclick): 18 (WebInspector.DataGrid.prototype._startEditing): 19 (WebInspector.DataGrid.prototype.handleKeyEvent): 20 (WebInspector.DataGrid.prototype.dataGridNodeFromEvent): 21 (WebInspector.DataGrid.prototype._mouseDownInDataTable): 22 (WebInspector.DataGrid.prototype._clickInDataTable): 23 * inspector/front-end/inspector.js: 24 (WebInspector.startEditing.element.handleKeyEvent): 25 (WebInspector.startEditing): 26 1 27 2009-11-18 Ben Murdoch <benm@google.com> 2 28 -
trunk/WebCore/inspector/front-end/DataGrid.js
r50613 r51119 143 143 return; 144 144 145 this._startEditing(event );145 this._startEditing(event.target); 146 146 }, 147 147 … … 157 157 }, 158 158 159 _startEditing: function( event)160 { 161 var element = event.target.enclosingNodeOrSelfWithNodeName("td");159 _startEditing: function(target) 160 { 161 var element = target.enclosingNodeOrSelfWithNodeName("td"); 162 162 if (!element) 163 163 return; 164 164 165 this._editingNode = this.dataGridNodeFrom Event(event);165 this._editingNode = this.dataGridNodeFromNode(target); 166 166 if (!this._editingNode) { 167 167 if (!this.creationNode) … … 521 521 this._deleteCallback(this.selectedNode); 522 522 } 523 } else if (isEnterKey(event)) { 524 if (this._editCallback) { 525 handled = true; 526 // The first child of the selected element is the <td class="0-column">, 527 // and that's what we want to edit. 528 this._startEditing(this.selectedNode._element.children[0]); 529 } 523 530 } 524 531 … … 551 558 }, 552 559 553 dataGridNodeFrom Event: function(event)554 { 555 var rowElement = event.target.enclosingNodeOrSelfWithNodeName("tr");560 dataGridNodeFromNode: function(target) 561 { 562 var rowElement = target.enclosingNodeOrSelfWithNodeName("tr"); 556 563 return rowElement._dataGridNode; 557 564 }, … … 598 605 _mouseDownInDataTable: function(event) 599 606 { 600 var gridNode = this.dataGridNodeFrom Event(event);607 var gridNode = this.dataGridNodeFromNode(event.target); 601 608 if (!gridNode || !gridNode.selectable) 602 609 return; … … 616 623 _clickInDataTable: function(event) 617 624 { 618 var gridNode = this.dataGridNodeFrom Event(event);625 var gridNode = this.dataGridNodeFromNode(event.target); 619 626 if (!gridNode || !gridNode.hasChildren) 620 627 return; -
trunk/WebCore/inspector/front-end/inspector.js
r50947 r51119 1681 1681 editingCommitted.call(element); 1682 1682 event.preventDefault(); 1683 event.stopPropagation(); 1684 event.handled = true; 1683 1685 } else if (event.keyCode === 27) { // Escape key 1684 1686 editingCancelled.call(element);
Note: See TracChangeset
for help on using the changeset viewer.