| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 InlineEditor.SwatchPopoverHelper = class extends Common.Object { | 7 InlineEditor.SwatchPopoverHelper = class extends Common.Object { |
| 8 constructor() { | 8 constructor() { |
| 9 super(); | 9 super(); |
| 10 this._popover = new UI.Popover(); | 10 this._popover = new UI.Popover(); |
| 11 this._popover.setCanShrink(false); | |
| 12 this._popover.setNoPadding(true); | 11 this._popover.setNoPadding(true); |
| 13 this._popover.element.addEventListener('mousedown', e => e.consume(), false)
; | 12 this._popover.element.addEventListener('mousedown', e => e.consume(), false)
; |
| 14 | 13 |
| 15 this._hideProxy = this.hide.bind(this, true); | 14 this._hideProxy = this.hide.bind(this, true); |
| 16 this._boundOnKeyDown = this._onKeyDown.bind(this); | 15 this._boundOnKeyDown = this._onKeyDown.bind(this); |
| 17 this._boundFocusOut = this._onFocusOut.bind(this); | 16 this._boundFocusOut = this._onFocusOut.bind(this); |
| 18 this._isHidden = true; | 17 this._isHidden = true; |
| 19 } | 18 } |
| 20 | 19 |
| 21 /** | 20 /** |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 this.hide(true); | 103 this.hide(true); |
| 105 event.consume(true); | 104 event.consume(true); |
| 106 return; | 105 return; |
| 107 } | 106 } |
| 108 if (event.key === 'Escape') { | 107 if (event.key === 'Escape') { |
| 109 this.hide(false); | 108 this.hide(false); |
| 110 event.consume(true); | 109 event.consume(true); |
| 111 } | 110 } |
| 112 } | 111 } |
| 113 }; | 112 }; |
| OLD | NEW |