Changeset 46520 in webkit
- Timestamp:
- Jul 28, 2009 9:54:07 PM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r46519 r46520 1 2009-07-28 Joseph Pecoraro <joepeck02@gmail.com> 2 3 Inspector: Tab Through the DOM Storage DataGrid when Editing 4 5 https://bugs.webkit.org/show_bug.cgi?id=27746 6 7 Reviewed by Timothy Hatcher. 8 9 * inspector/front-end/DOMStorageDataGrid.js: 10 (WebInspector.DOMStorageDataGrid.prototype._startEditingColumnOfDataGridNode): refactored to directly edit and select a column 11 (WebInspector.DOMStorageDataGrid.prototype._startEditing): 12 (WebInspector.DOMStorageDataGrid.prototype._editingCommitted.moveToNextIfNeeded): handles moveDirection on a commit 13 (WebInspector.DOMStorageDataGrid.prototype._editingCommitted): uses moveToNext to traverse appropriately 14 1 15 2009-07-28 Joseph Pecoraro <joepeck02@gmail.com> 2 16 -
trunk/WebCore/inspector/front-end/DOMStorageDataGrid.js
r46519 r46520 40 40 }, 41 41 42 _startEditingColumnOfDataGridNode: function(node, column) 43 { 44 this._editing = true; 45 this._editingNode = node; 46 this._editingNode.select(); 47 48 var element = this._editingNode._element.children[column]; 49 WebInspector.startEditing(element, this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent); 50 window.getSelection().setBaseAndExtent(element, 0, element, 1); 51 }, 52 42 53 _startEditing: function(event) 43 54 { … … 52 63 this._editingNode = this.creationNode; 53 64 } 65 66 // Force editing the "Key" column when editing the creation node 67 if (this._editingNode.isCreationNode) 68 return this._startEditingColumnOfDataGridNode(this._editingNode, 0); 69 54 70 this._editing = true; 55 56 if (this._editingNode.isCreationNode) {57 this._editingNode.select();58 element = this._editingNode._element.children[0]; // Create a new node by providing a Key First59 }60 61 71 WebInspector.startEditing(element, this._editingCommitted.bind(this), this._editingCancelled.bind(this), element.textContent); 62 72 window.getSelection().setBaseAndExtent(element, 0, element, 1); 63 73 }, 64 74 65 _editingCommitted: function(element, newText )75 _editingCommitted: function(element, newText, oldText, context, moveDirection) 66 76 { 67 77 var columnIdentifier = (element.hasStyleClass("0-column") ? 0 : 1); 68 78 var textBeforeEditing = this._editingNode.data[columnIdentifier]; 79 var currentEditingNode = this._editingNode; 80 81 function moveToNextIfNeeded(wasChange) { 82 if (!moveDirection) 83 return; 84 85 if (moveDirection === "forward") { 86 if (currentEditingNode.isCreationNode && columnIdentifier === 0 && !wasChange) 87 return; 88 89 if (columnIdentifier === 0) 90 return this._startEditingColumnOfDataGridNode(currentEditingNode, 1); 91 92 var nextDataGridNode = currentEditingNode.traverseNextNode(true, null, true); 93 if (nextDataGridNode) 94 return this._startEditingColumnOfDataGridNode(nextDataGridNode, 0); 95 if (currentEditingNode.isCreationNode && wasChange) { 96 addCreationNode(false); 97 return this._startEditingColumnOfDataGridNode(this.creationNode, 0); 98 } 99 return; 100 } 101 102 if (moveDirection === "backward") { 103 if (columnIdentifier === 1) 104 return this._startEditingColumnOfDataGridNode(currentEditingNode, 0); 105 var nextDataGridNode = currentEditingNode.traversePreviousNode(true, null, true); 106 107 if (nextDataGridNode) 108 return this._startEditingColumnOfDataGridNode(nextDataGridNode, 1); 109 return; 110 } 111 } 112 69 113 if (textBeforeEditing == newText) { 70 114 this._editingCancelled(element); 115 moveToNextIfNeeded.call(this, false); 71 116 return; 72 117 } … … 78 123 element.textContent = this._editingNode.data[0]; 79 124 this._editingCancelled(element); 125 moveToNextIfNeeded.call(this, false); 80 126 return; 81 127 } … … 93 139 94 140 this._editingCancelled(element); 141 moveToNextIfNeeded.call(this, true); 95 142 }, 96 143
Note: See TracChangeset
for help on using the changeset viewer.