Changeset 83951 in webkit
- Timestamp:
- Apr 14, 2011 11:29:40 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r83950 r83951 1 2011-04-14 Andrey Adaikin <aandrey@google.com> 2 3 Reviewed by Pavel Feldman. 4 5 Web Inspector: Ctrl+Left/Right switch panels during live editing 6 https://bugs.webkit.org/show_bug.cgi?id=58521 7 8 Disable Ctrl+Left/Right keyboard shortcuts while in live edit. 9 10 * inspector/front-end/SourceFrame.js: 11 (WebInspector.SourceFrame.prototype.readOnlyStateChanged): 12 * inspector/front-end/TextViewer.js: 13 (WebInspector.TextViewer.prototype.set readOnly): 14 (WebInspector.TextViewer.prototype.get readOnly): 15 (WebInspector.TextViewer.prototype._doubleClick): 16 (WebInspector.TextViewer.prototype._commitEditing.didCommitEditing): 17 (WebInspector.TextViewer.prototype._commitEditing): 18 (WebInspector.TextViewer.prototype._cancelEditing): 19 (WebInspector.TextViewerDelegate.prototype.readOnlyStateChanged): 20 (WebInspector.TextEditorMainPanel.prototype.set readOnly): 21 * inspector/front-end/inspector.js: 22 (WebInspector.markBeingEdited): 23 (WebInspector.isEditingAnyField): 24 (WebInspector.startEditing.cleanUpAfterEditing): 25 1 26 2011-04-14 Vsevolod Vlasov <vsevik@chromium.org> 2 27 -
trunk/Source/WebCore/inspector/front-end/SourceFrame.js
r83843 r83951 239 239 }, 240 240 241 readOnlyStateChanged: function(readOnly) 242 { 243 WebInspector.markBeingEdited(this._textViewer.element, !readOnly); 244 }, 245 241 246 startEditing: function() 242 247 { -
trunk/Source/WebCore/inspector/front-end/TextViewer.js
r83725 r83951 67 67 }, 68 68 69 set readOnly(readOnly) 70 { 71 if (this._mainPanel.readOnly === readOnly) 72 return; 73 this._mainPanel.readOnly = readOnly; 74 this._delegate.readOnlyStateChanged(readOnly); 75 }, 76 77 get readOnly() 78 { 79 return this._mainPanel.readOnly; 80 }, 81 69 82 get textModel() 70 83 { … … 215 228 _doubleClick: function(event) 216 229 { 217 if (!this. _mainPanel.readOnly || this._commitEditingInProgress)230 if (!this.readOnly || this._commitEditingInProgress) 218 231 return; 219 232 … … 225 238 return; 226 239 227 this. _mainPanel.readOnly = false;240 this.readOnly = false; 228 241 window.getSelection().collapseToStart(); 229 242 }, … … 259 272 _commitEditing: function() 260 273 { 261 if (this. _mainPanel.readOnly)274 if (this.readOnly) 262 275 return false; 263 276 264 this. _mainPanel.readOnly = true;277 this.readOnly = true; 265 278 function didCommitEditing(error) 266 279 { 267 280 this._commitEditingInProgress = false; 268 281 if (error) 269 this. _mainPanel.readOnly = false;282 this.readOnly = false; 270 283 } 271 284 this._commitEditingInProgress = true; … … 276 289 _cancelEditing: function() 277 290 { 278 if (this. _mainPanel.readOnly)291 if (this.readOnly) 279 292 return false; 280 293 281 this. _mainPanel.readOnly = true;294 this.readOnly = true; 282 295 this._delegate.cancelEditing(); 283 296 return true; … … 298 311 WebInspector.TextViewerDelegate.prototype = { 299 312 isContentEditable: function() 313 { 314 // Should be implemented by subclasses. 315 }, 316 317 readOnlyStateChanged: function(readOnly) 300 318 { 301 319 // Should be implemented by subclasses. … … 836 854 set readOnly(readOnly) 837 855 { 856 if (this._readOnly === readOnly) 857 return; 858 838 859 this.beginDomUpdates(); 839 860 this._readOnly = readOnly; -
trunk/Source/WebCore/inspector/front-end/inspector.js
r83864 r83951 1433 1433 } 1434 1434 1435 WebInspector.markBeingEdited = function(element, value) 1436 { 1437 if (value) { 1438 if (element.__editing) 1439 return false; 1440 element.__editing = true; 1441 WebInspector.__editingCount = (WebInspector.__editingCount || 0) + 1; 1442 } else { 1443 if (!element.__editing) 1444 return false; 1445 delete element.__editing; 1446 --WebInspector.__editingCount; 1447 } 1448 return true; 1449 } 1450 1435 1451 WebInspector.isEditingAnyField = function() 1436 1452 { 1437 return this.__editing;1453 return !!WebInspector.__editingCount; 1438 1454 } 1439 1455 … … 1447 1463 WebInspector.startEditing = function(element, config) 1448 1464 { 1449 if ( element.__editing)1465 if (!WebInspector.markBeingEdited(element, true)) 1450 1466 return; 1451 element.__editing = true;1452 WebInspector.__editing = true;1453 1467 1454 1468 config = config || {}; … … 1478 1492 1479 1493 function cleanUpAfterEditing() { 1480 delete this.__editing; 1481 delete WebInspector.__editing; 1494 WebInspector.markBeingEdited(element, false); 1482 1495 1483 1496 this.removeStyleClass("editing");
Note: See TracChangeset
for help on using the changeset viewer.