OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @constructor | 6 * @constructor |
7 * @extends {WebInspector.Object} | 7 * @extends {WebInspector.Object} |
8 */ | 8 */ |
9 WebInspector.StylesPopoverHelper = function() | 9 WebInspector.StylesPopoverHelper = function() |
10 { | 10 { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 this._view.contentElement.removeEventListener("focusout", this._boun
dFocusOut, false); | 112 this._view.contentElement.removeEventListener("focusout", this._boun
dFocusOut, false); |
113 delete this._view; | 113 delete this._view; |
114 } | 114 } |
115 }, | 115 }, |
116 | 116 |
117 /** | 117 /** |
118 * @param {!Event} event | 118 * @param {!Event} event |
119 */ | 119 */ |
120 _onKeyDown: function(event) | 120 _onKeyDown: function(event) |
121 { | 121 { |
122 if (event.keyIdentifier === "Enter") { | 122 if (event.key === "Enter") { |
123 this.hide(true); | 123 this.hide(true); |
124 event.consume(true); | 124 event.consume(true); |
125 return; | 125 return; |
126 } | 126 } |
127 if (event.keyIdentifier === "U+001B") { // Escape key | 127 if (event.key === "Escape") { |
128 this.hide(false); | 128 this.hide(false); |
129 event.consume(true); | 129 event.consume(true); |
130 } | 130 } |
131 }, | 131 }, |
132 | 132 |
133 __proto__: WebInspector.Object.prototype | 133 __proto__: WebInspector.Object.prototype |
134 } | 134 } |
135 | 135 |
136 /** | 136 /** |
137 * @constructor | 137 * @constructor |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 { | 340 { |
341 this._spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorCha
nged, this._boundSpectrumChanged); | 341 this._spectrum.removeEventListener(WebInspector.Spectrum.Events.ColorCha
nged, this._boundSpectrumChanged); |
342 delete this._spectrum; | 342 delete this._spectrum; |
343 | 343 |
344 var propertyText = commitEdit ? this._treeElement.renderedPropertyText()
: this._originalPropertyText; | 344 var propertyText = commitEdit ? this._treeElement.renderedPropertyText()
: this._originalPropertyText; |
345 this._treeElement.applyStyleText(propertyText, true); | 345 this._treeElement.applyStyleText(propertyText, true); |
346 this._treeElement.parentPane().setEditingStyle(false); | 346 this._treeElement.parentPane().setEditingStyle(false); |
347 delete this._originalPropertyText; | 347 delete this._originalPropertyText; |
348 } | 348 } |
349 } | 349 } |
OLD | NEW |