| 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.GlassPane(); | 10 this._popover = new UI.GlassPane(); |
| 11 this._popover.registerRequiredCSS('inline_editor/swatchPopover.css'); | 11 this._popover.registerRequiredCSS('inline_editor/swatchPopover.css'); |
| 12 this._popover.setBlockPointerEvents(false); | |
| 13 this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); | 12 this._popover.setSizeBehavior(UI.GlassPane.SizeBehavior.MeasureContent); |
| 14 this._popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow); | 13 this._popover.setMarginBehavior(UI.GlassPane.MarginBehavior.Arrow); |
| 15 this._popover.element.addEventListener('mousedown', e => e.consume(), false)
; | 14 this._popover.element.addEventListener('mousedown', e => e.consume(), false)
; |
| 16 | 15 |
| 17 this._hideProxy = this.hide.bind(this, true); | 16 this._hideProxy = this.hide.bind(this, true); |
| 18 this._boundOnKeyDown = this._onKeyDown.bind(this); | 17 this._boundOnKeyDown = this._onKeyDown.bind(this); |
| 19 this._boundFocusOut = this._onFocusOut.bind(this); | 18 this._boundFocusOut = this._onFocusOut.bind(this); |
| 20 this._isHidden = true; | 19 this._isHidden = true; |
| 21 } | 20 } |
| 22 | 21 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 this.hide(true); | 107 this.hide(true); |
| 109 event.consume(true); | 108 event.consume(true); |
| 110 return; | 109 return; |
| 111 } | 110 } |
| 112 if (event.key === 'Escape') { | 111 if (event.key === 'Escape') { |
| 113 this.hide(false); | 112 this.hide(false); |
| 114 event.consume(true); | 113 event.consume(true); |
| 115 } | 114 } |
| 116 } | 115 } |
| 117 }; | 116 }; |
| OLD | NEW |