| 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) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 this._updateTarget(newNode? newNode.target() : null); | 94 this._updateTarget(newNode? newNode.target() : null); |
| 95 if (newNode) | 95 if (newNode) |
| 96 this._updateInputs(newNode); | 96 this._updateInputs(newNode); |
| 97 }, | 97 }, |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * @param {!WebInspector.DOMNode} node | 100 * @param {!WebInspector.DOMNode} node |
| 101 */ | 101 */ |
| 102 _updateInputs: function(node) | 102 _updateInputs: function(node) |
| 103 { | 103 { |
| 104 var nodePseudoState = node.getUserProperty(WebInspector.CSSStyleModel.Ps
eudoStatePropertyName) || []; | 104 var nodePseudoState = this._target.cssModel.pseudoState(node); |
| 105 var inputs = this._inputs; | 105 var inputs = this._inputs; |
| 106 for (var i = 0; i < inputs.length; ++i) { | 106 for (var i = 0; i < inputs.length; ++i) { |
| 107 inputs[i].disabled = !!node.pseudoType(); | 107 inputs[i].disabled = !!node.pseudoType(); |
| 108 inputs[i].checked = nodePseudoState.indexOf(inputs[i].state) >= 0; | 108 inputs[i].checked = nodePseudoState.indexOf(inputs[i].state) >= 0; |
| 109 } | 109 } |
| 110 }, | 110 }, |
| 111 | 111 |
| 112 __proto__: WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype | 112 __proto__: WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype |
| 113 } | 113 } |
| 114 | 114 |
| (...skipping 27 matching lines...) Expand all Loading... |
| 142 }, | 142 }, |
| 143 | 143 |
| 144 _nodeChanged: function() | 144 _nodeChanged: function() |
| 145 { | 145 { |
| 146 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode); | 146 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode); |
| 147 this._button.setEnabled(enabled); | 147 this._button.setEnabled(enabled); |
| 148 if (!enabled && this._button.toggled()) | 148 if (!enabled && this._button.toggled()) |
| 149 WebInspector.ElementsPanel.instance().sidebarPanes.styles.showToolba
rPane(null); | 149 WebInspector.ElementsPanel.instance().sidebarPanes.styles.showToolba
rPane(null); |
| 150 } | 150 } |
| 151 } | 151 } |
| OLD | NEW |