| OLD | NEW |
| 1 | 1 |
| 2 // Copyright 2014 The Chromium Authors. All rights reserved. | 2 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 3 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
| 4 // found in the LICENSE file. | 4 // found in the LICENSE file. |
| 5 | 5 |
| 6 /** | 6 /** |
| 7 * @constructor | 7 * @constructor |
| 8 * @implements {WebInspector.SourcesPanel.EditorAction} | 8 * @implements {WebInspector.SourcesPanel.EditorAction} |
| 9 */ | 9 */ |
| 10 WebInspector.InplaceFormatterEditorAction = function() | 10 WebInspector.InplaceFormatterEditorAction = function() |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 var wasSelected = /** @type {boolean} */ (event.data.wasSelected); | 29 var wasSelected = /** @type {boolean} */ (event.data.wasSelected); |
| 30 if (wasSelected) | 30 if (wasSelected) |
| 31 this._updateButton(null); | 31 this._updateButton(null); |
| 32 }, | 32 }, |
| 33 | 33 |
| 34 /** | 34 /** |
| 35 * @param {?WebInspector.UISourceCode} uiSourceCode | 35 * @param {?WebInspector.UISourceCode} uiSourceCode |
| 36 */ | 36 */ |
| 37 _updateButton: function(uiSourceCode) | 37 _updateButton: function(uiSourceCode) |
| 38 { | 38 { |
| 39 this._button.element.enableStyleClass("hidden", !this._isFormattable(uiS
ourceCode)); | 39 this._button.element.classList.toggle("hidden", !this._isFormattable(uiS
ourceCode)); |
| 40 }, | 40 }, |
| 41 | 41 |
| 42 /** | 42 /** |
| 43 * @param {!WebInspector.SourcesPanel} panel | 43 * @param {!WebInspector.SourcesPanel} panel |
| 44 * @return {!Element} | 44 * @return {!Element} |
| 45 */ | 45 */ |
| 46 button: function(panel) | 46 button: function(panel) |
| 47 { | 47 { |
| 48 if (this._button) | 48 if (this._button) |
| 49 return this._button.element; | 49 return this._button.element; |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 var start = [0, 0]; | 106 var start = [0, 0]; |
| 107 if (sourceFrame) { | 107 if (sourceFrame) { |
| 108 var selection = sourceFrame.selection(); | 108 var selection = sourceFrame.selection(); |
| 109 start = formatterMapping.originalToFormatted(selection.startLine
, selection.startColumn); | 109 start = formatterMapping.originalToFormatted(selection.startLine
, selection.startColumn); |
| 110 } | 110 } |
| 111 uiSourceCode.setWorkingCopy(formattedContent); | 111 uiSourceCode.setWorkingCopy(formattedContent); |
| 112 this._panel.showUISourceCode(uiSourceCode, start[0], start[1]); | 112 this._panel.showUISourceCode(uiSourceCode, start[0], start[1]); |
| 113 } | 113 } |
| 114 }, | 114 }, |
| 115 } | 115 } |
| OLD | NEW |