Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(214)

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js

Issue 1574213006: DevTools: beautified styles sidebar toolbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comments addressed. Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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.ElementStatePaneWidget = function(toolbarItem) 10 WebInspector.ElementStatePaneWidget = function(toolbarItem)
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 117
118 __proto__: WebInspector.ElementsPanel.BaseToolbarPaneWidget.prototype 118 __proto__: WebInspector.ElementsPanel.BaseToolbarPaneWidget.prototype
119 } 119 }
120 120
121 /** 121 /**
122 * @constructor 122 * @constructor
123 * @implements {WebInspector.ToolbarItem.Provider} 123 * @implements {WebInspector.ToolbarItem.Provider}
124 */ 124 */
125 WebInspector.ElementStatePaneWidget.ButtonProvider = function() 125 WebInspector.ElementStatePaneWidget.ButtonProvider = function()
126 { 126 {
127 this._button = new WebInspector.ToolbarToggle(WebInspector.UIString("Toggle Element State"), "pin-toolbar-item"); 127 this._button = new WebInspector.ToolbarToggle(WebInspector.UIString("Toggle Element State"), "", WebInspector.UIString(":hov"));
128 this._button.addEventListener("click", this._clicked, this); 128 this._button.addEventListener("click", this._clicked, this);
129 this._button.element.classList.add("monospace");
129 this._view = new WebInspector.ElementStatePaneWidget(this.item()); 130 this._view = new WebInspector.ElementStatePaneWidget(this.item());
130 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this); 131 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this);
131 this._nodeChanged(); 132 this._nodeChanged();
132 } 133 }
133 134
134 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = { 135 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = {
135 _clicked: function() 136 _clicked: function()
136 { 137 {
137 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow ing() ? this._view : null); 138 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow ing() ? this._view : null);
138 }, 139 },
139 140
140 /** 141 /**
141 * @override 142 * @override
142 * @return {!WebInspector.ToolbarItem} 143 * @return {!WebInspector.ToolbarItem}
143 */ 144 */
144 item: function() 145 item: function()
145 { 146 {
146 return this._button; 147 return this._button;
147 }, 148 },
148 149
149 _nodeChanged: function() 150 _nodeChanged: function()
150 { 151 {
151 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode); 152 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode);
152 this._button.setEnabled(enabled); 153 this._button.setEnabled(enabled);
153 if (!enabled && this._button.toggled()) 154 if (!enabled && this._button.toggled())
154 WebInspector.ElementsPanel.instance().showToolbarPane(null); 155 WebInspector.ElementsPanel.instance().showToolbarPane(null);
155 } 156 }
156 } 157 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698