Changeset 157966 in webkit
- Timestamp:
- Oct 24, 2013 5:15:38 PM (10 years ago)
- Location:
- trunk/Source/WebInspectorUI
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebInspectorUI/ChangeLog
r157947 r157966 1 2013-10-24 Timothy Hatcher <timothy@apple.com> 2 3 Allow editing CSS resources after they have been pretty printed. 4 5 https://bugs.webkit.org/show_bug.cgi?id=123297 6 7 Reviewed by Joseph Pecoraro. 8 9 * UserInterface/TextEditor.js: 10 (WebInspector.TextEditor): Remove the need for _readOnly. 11 (WebInspector.TextEditor.prototype.set readOnly): Set CodeMirror readOnly directly. 12 (WebInspector.TextEditor.prototype.set formatted): Don't call _updateCodeMirrorReadOnly. 13 (WebInspector.TextEditor.prototype._updateCodeMirrorReadOnly): Removed. 14 (WebInspector.TextEditor.prototype._contentChanged): Clear _formatted and _formatterSourceMap 15 on edit and notify the delegate and fire the FormattingDidChange event. 16 1 17 2013-10-24 Timothy Hatcher <timothy@apple.com> 2 18 -
trunk/Source/WebInspectorUI/UserInterface/TextEditor.js
r157601 r157966 33 33 this._element.classList.add(WebInspector.SyntaxHighlightedStyleClassName); 34 34 35 this._readOnly = true;36 37 35 this._codeMirror = CodeMirror(this.element, { 38 readOnly: t his._readOnly,36 readOnly: true, 39 37 indentWithTabs: true, 40 38 indentUnit: 4, … … 149 147 set readOnly(readOnly) 150 148 { 151 this._readOnly = readOnly; 152 this._updateCodeMirrorReadOnly(); 149 this._codeMirror.setOption("readOnly", readOnly); 153 150 }, 154 151 … … 172 169 173 170 this._formatted = formatted; 174 this._updateCodeMirrorReadOnly();175 171 176 172 this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange); … … 595 591 // Private 596 592 597 _updateCodeMirrorReadOnly: function()598 {599 this._codeMirror.setOption("readOnly", this._readOnly || this._formatted);600 },601 602 593 _contentChanged: function(codeMirror, change) 603 594 { 604 595 if (this._ignoreCodeMirrorContentDidChangeEvent) 605 596 return; 597 598 if (this._formatted) { 599 this._formatterSourceMap = null; 600 this._formatted = false; 601 602 if (this._delegate && typeof this._delegate.textEditorUpdatedFormatting === "function") 603 this._delegate.textEditorUpdatedFormatting(this); 604 605 this.dispatchEventToListeners(WebInspector.TextEditor.Event.FormattingDidChange); 606 } 607 606 608 this.dispatchEventToListeners(WebInspector.TextEditor.Event.ContentDidChange); 607 609 },
Note: See TracChangeset
for help on using the changeset viewer.