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.StylesSidebarPane.BaseToolbarPaneWidget} | 7 * @extends {WebInspector.StylesSidebarPane.BaseToolbarPaneWidget} |
8 * @param {!WebInspector.ToolbarItem} toolbarItem | 8 * @param {!WebInspector.ToolbarItem} toolbarItem |
9 */ | 9 */ |
10 WebInspector.ElementStatePaneWidget = function(toolbarItem) | 10 WebInspector.ElementStatePaneWidget = function(toolbarItem) |
11 { | 11 { |
12 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.call(this, toolbarItem)
; | 12 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.call(this, toolbarItem)
; |
13 this.element.className = "styles-element-state-pane source-code"; | 13 this.element.className = "styles-element-state-pane"; |
14 var table = createElement("table"); | 14 this.element.createChild("div").createTextChild(WebInspector.UIString("Force
element state")); |
| 15 var table = createElementWithClass("table", "source-code"); |
15 | 16 |
16 var inputs = []; | 17 var inputs = []; |
17 this._inputs = inputs; | 18 this._inputs = inputs; |
18 | 19 |
19 /** | 20 /** |
20 * @param {!Event} event | 21 * @param {!Event} event |
21 */ | 22 */ |
22 function clickListener(event) | 23 function clickListener(event) |
23 { | 24 { |
24 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 25 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 116 |
116 __proto__: WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype | 117 __proto__: WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype |
117 } | 118 } |
118 | 119 |
119 /** | 120 /** |
120 * @constructor | 121 * @constructor |
121 * @implements {WebInspector.ToolbarItem.Provider} | 122 * @implements {WebInspector.ToolbarItem.Provider} |
122 */ | 123 */ |
123 WebInspector.ElementStatePaneWidget.ButtonProvider = function() | 124 WebInspector.ElementStatePaneWidget.ButtonProvider = function() |
124 { | 125 { |
125 this._button = new WebInspector.ToolbarButton(WebInspector.UIString("Toggle
Element State"), "element-state-toolbar-item"); | 126 this._button = new WebInspector.ToolbarButton(WebInspector.UIString("Toggle
Element State"), "pin-toolbar-item"); |
126 this._button.addEventListener("click", this._clicked, this); | 127 this._button.addEventListener("click", this._clicked, this); |
127 this._view = new WebInspector.ElementStatePaneWidget(this.item()); | 128 this._view = new WebInspector.ElementStatePaneWidget(this.item()); |
128 } | 129 } |
129 | 130 |
130 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = { | 131 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = { |
131 _clicked: function() | 132 _clicked: function() |
132 { | 133 { |
133 var stylesSidebarPane = WebInspector.ElementsPanel.instance().sidebarPan
es.styles; | 134 var stylesSidebarPane = WebInspector.ElementsPanel.instance().sidebarPan
es.styles; |
134 stylesSidebarPane.showToolbarPane(!this._view.isShowing() ? this._view :
null); | 135 stylesSidebarPane.showToolbarPane(!this._view.isShowing() ? this._view :
null); |
135 }, | 136 }, |
136 | 137 |
137 /** | 138 /** |
138 * @override | 139 * @override |
139 * @return {!WebInspector.ToolbarItem} | 140 * @return {!WebInspector.ToolbarItem} |
140 */ | 141 */ |
141 item: function() | 142 item: function() |
142 { | 143 { |
143 return this._button; | 144 return this._button; |
144 } | 145 } |
145 } | 146 } |
OLD | NEW |