| 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.ElementsPanel.BaseToolbarPaneWidget} | 7 * @extends {WebInspector.ElementsPanel.BaseToolbarPaneWidget} |
| 8 * @param {!WebInspector.ToolbarItem} toolbarItem | 8 * @param {!WebInspector.ToolbarItem} toolbarItem |
| 9 */ | 9 */ |
| 10 WebInspector.ClassesPaneWidget = function(toolbarItem) | 10 WebInspector.ClassesPaneWidget = function(toolbarItem) |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 } | 180 } |
| 181 | 181 |
| 182 /** | 182 /** |
| 183 * @constructor | 183 * @constructor |
| 184 * @implements {WebInspector.ToolbarItem.Provider} | 184 * @implements {WebInspector.ToolbarItem.Provider} |
| 185 */ | 185 */ |
| 186 WebInspector.ClassesPaneWidget.ButtonProvider = function() | 186 WebInspector.ClassesPaneWidget.ButtonProvider = function() |
| 187 { | 187 { |
| 188 this._button = new WebInspector.ToolbarToggle(WebInspector.UIString("Element
Classes"), ""); | 188 this._button = new WebInspector.ToolbarToggle(WebInspector.UIString("Element
Classes"), ""); |
| 189 this._button.setText(".cls"); | 189 this._button.setText(".cls"); |
| 190 this._button.element.classList.add("monospace"); |
| 190 this._button.addEventListener("click", this._clicked, this); | 191 this._button.addEventListener("click", this._clicked, this); |
| 191 this._view = new WebInspector.ClassesPaneWidget(this.item()); | 192 this._view = new WebInspector.ClassesPaneWidget(this.item()); |
| 192 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod
eChanged, this); | 193 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod
eChanged, this); |
| 193 this._nodeChanged(); | 194 this._nodeChanged(); |
| 194 } | 195 } |
| 195 | 196 |
| 196 WebInspector.ClassesPaneWidget.ButtonProvider.prototype = { | 197 WebInspector.ClassesPaneWidget.ButtonProvider.prototype = { |
| 197 _clicked: function() | 198 _clicked: function() |
| 198 { | 199 { |
| 199 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow
ing() ? this._view : null); | 200 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow
ing() ? this._view : null); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 210 | 211 |
| 211 _nodeChanged: function() | 212 _nodeChanged: function() |
| 212 { | 213 { |
| 213 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 214 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 214 var enabled = !!node; | 215 var enabled = !!node; |
| 215 this._button.setEnabled(enabled); | 216 this._button.setEnabled(enabled); |
| 216 if (!enabled && this._button.toggled()) | 217 if (!enabled && this._button.toggled()) |
| 217 WebInspector.ElementsPanel.instance().showToolbarPane(null); | 218 WebInspector.ElementsPanel.instance().showToolbarPane(null); |
| 218 } | 219 } |
| 219 } | 220 } |
| OLD | NEW |