| 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 * @unrestricted | 5 * @unrestricted |
| 6 */ | 6 */ |
| 7 Elements.ElementStatePaneWidget = class extends UI.Widget { | 7 Elements.ElementStatePaneWidget = class extends UI.Widget { |
| 8 constructor() { | 8 constructor() { |
| 9 super(); | 9 super(); |
| 10 this.element.className = 'styles-element-state-pane'; | 10 this.element.className = 'styles-element-state-pane'; |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 /** | 103 /** |
| 104 * @implements {UI.ToolbarItem.Provider} | 104 * @implements {UI.ToolbarItem.Provider} |
| 105 * @unrestricted | 105 * @unrestricted |
| 106 */ | 106 */ |
| 107 Elements.ElementStatePaneWidget.ButtonProvider = class { | 107 Elements.ElementStatePaneWidget.ButtonProvider = class { |
| 108 constructor() { | 108 constructor() { |
| 109 this._button = new UI.ToolbarToggle(Common.UIString('Toggle Element State'),
''); | 109 this._button = new UI.ToolbarToggle(Common.UIString('Toggle Element State'),
''); |
| 110 this._button.setText(Common.UIString(':hov')); | 110 this._button.setText(Common.UIString(':hov')); |
| 111 this._button.addEventListener(UI.ToolbarButton.Events.Click, this._clicked,
this); | 111 this._button.addEventListener('click', this._clicked, this); |
| 112 this._button.element.classList.add('monospace'); | 112 this._button.element.classList.add('monospace'); |
| 113 this._view = new Elements.ElementStatePaneWidget(); | 113 this._view = new Elements.ElementStatePaneWidget(); |
| 114 } | 114 } |
| 115 | 115 |
| 116 _clicked() { | 116 _clicked() { |
| 117 Elements.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ?
this._view : null, this._button); | 117 Elements.ElementsPanel.instance().showToolbarPane(!this._view.isShowing() ?
this._view : null, this._button); |
| 118 } | 118 } |
| 119 | 119 |
| 120 /** | 120 /** |
| 121 * @override | 121 * @override |
| 122 * @return {!UI.ToolbarItem} | 122 * @return {!UI.ToolbarItem} |
| 123 */ | 123 */ |
| 124 item() { | 124 item() { |
| 125 return this._button; | 125 return this._button; |
| 126 } | 126 } |
| 127 }; | 127 }; |
| OLD | NEW |