| 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(true); |
| 10 this.element.className = 'styles-element-state-pane'; | 10 this.registerRequiredCSS('elements/elementStatePaneWidget.css'); |
| 11 this.element.createChild('div').createTextChild(Common.UIString('Force eleme
nt state')); | 11 this.contentElement.className = 'styles-element-state-pane'; |
| 12 this.contentElement.createChild('div').createTextChild(Common.UIString('Forc
e element state')); |
| 12 var table = createElementWithClass('table', 'source-code'); | 13 var table = createElementWithClass('table', 'source-code'); |
| 13 | 14 |
| 14 var inputs = []; | 15 var inputs = []; |
| 15 this._inputs = inputs; | 16 this._inputs = inputs; |
| 16 | 17 |
| 17 /** | 18 /** |
| 18 * @param {!Event} event | 19 * @param {!Event} event |
| 19 */ | 20 */ |
| 20 function clickListener(event) { | 21 function clickListener(event) { |
| 21 var node = UI.context.flavor(SDK.DOMNode); | 22 var node = UI.context.flavor(SDK.DOMNode); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 40 } | 41 } |
| 41 | 42 |
| 42 var tr = table.createChild('tr'); | 43 var tr = table.createChild('tr'); |
| 43 tr.appendChild(createCheckbox.call(null, 'active')); | 44 tr.appendChild(createCheckbox.call(null, 'active')); |
| 44 tr.appendChild(createCheckbox.call(null, 'hover')); | 45 tr.appendChild(createCheckbox.call(null, 'hover')); |
| 45 | 46 |
| 46 tr = table.createChild('tr'); | 47 tr = table.createChild('tr'); |
| 47 tr.appendChild(createCheckbox.call(null, 'focus')); | 48 tr.appendChild(createCheckbox.call(null, 'focus')); |
| 48 tr.appendChild(createCheckbox.call(null, 'visited')); | 49 tr.appendChild(createCheckbox.call(null, 'visited')); |
| 49 | 50 |
| 50 this.element.appendChild(table); | 51 this.contentElement.appendChild(table); |
| 51 UI.context.addFlavorChangeListener(SDK.DOMNode, this._update, this); | 52 UI.context.addFlavorChangeListener(SDK.DOMNode, this._update, this); |
| 52 } | 53 } |
| 53 | 54 |
| 54 /** | 55 /** |
| 55 * @param {?SDK.CSSModel} cssModel | 56 * @param {?SDK.CSSModel} cssModel |
| 56 */ | 57 */ |
| 57 _updateModel(cssModel) { | 58 _updateModel(cssModel) { |
| 58 if (this._cssModel === cssModel) | 59 if (this._cssModel === cssModel) |
| 59 return; | 60 return; |
| 60 if (this._cssModel) | 61 if (this._cssModel) |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 114 } |
| 114 | 115 |
| 115 /** | 116 /** |
| 116 * @override | 117 * @override |
| 117 * @return {!UI.ToolbarItem} | 118 * @return {!UI.ToolbarItem} |
| 118 */ | 119 */ |
| 119 item() { | 120 item() { |
| 120 return this._button; | 121 return this._button; |
| 121 } | 122 } |
| 122 }; | 123 }; |
| OLD | NEW |