| 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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 __proto__: WebInspector.ElementsPanel.BaseToolbarPaneWidget.prototype | 179 __proto__: WebInspector.ElementsPanel.BaseToolbarPaneWidget.prototype |
| 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(".class"); |
| 190 this._button.addEventListener("click", this._clicked, this); | 190 this._button.addEventListener("click", this._clicked, this); |
| 191 this._view = new WebInspector.ClassesPaneWidget(this.item()); | 191 this._view = new WebInspector.ClassesPaneWidget(this.item()); |
| 192 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod
eChanged, this); | 192 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod
eChanged, this); |
| 193 this._nodeChanged(); | 193 this._nodeChanged(); |
| 194 } | 194 } |
| 195 | 195 |
| 196 WebInspector.ClassesPaneWidget.ButtonProvider.prototype = { | 196 WebInspector.ClassesPaneWidget.ButtonProvider.prototype = { |
| 197 _clicked: function() | 197 _clicked: function() |
| 198 { | 198 { |
| 199 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow
ing() ? this._view : null); | 199 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow
ing() ? this._view : null); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 210 | 210 |
| 211 _nodeChanged: function() | 211 _nodeChanged: function() |
| 212 { | 212 { |
| 213 var node = WebInspector.context.flavor(WebInspector.DOMNode); | 213 var node = WebInspector.context.flavor(WebInspector.DOMNode); |
| 214 var enabled = !!node; | 214 var enabled = !!node; |
| 215 this._button.setEnabled(enabled); | 215 this._button.setEnabled(enabled); |
| 216 if (!enabled && this._button.toggled()) | 216 if (!enabled && this._button.toggled()) |
| 217 WebInspector.ElementsPanel.instance().showToolbarPane(null); | 217 WebInspector.ElementsPanel.instance().showToolbarPane(null); |
| 218 } | 218 } |
| 219 } | 219 } |
| OLD | NEW |