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

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: rebaselined 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(":hover"));
dgozman 2016/01/14 22:05:21 Kill the class and image as well?
128 this._button.addEventListener("click", this._clicked, this); 128 this._button.addEventListener("click", this._clicked, this);
129 this._view = new WebInspector.ElementStatePaneWidget(this.item()); 129 this._view = new WebInspector.ElementStatePaneWidget(this.item());
130 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this); 130 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this);
131 this._nodeChanged(); 131 this._nodeChanged();
132 } 132 }
133 133
134 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = { 134 WebInspector.ElementStatePaneWidget.ButtonProvider.prototype = {
135 _clicked: function() 135 _clicked: function()
136 { 136 {
137 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow ing() ? this._view : null); 137 WebInspector.ElementsPanel.instance().showToolbarPane(!this._view.isShow ing() ? this._view : null);
138 }, 138 },
139 139
140 /** 140 /**
141 * @override 141 * @override
142 * @return {!WebInspector.ToolbarItem} 142 * @return {!WebInspector.ToolbarItem}
143 */ 143 */
144 item: function() 144 item: function()
145 { 145 {
146 return this._button; 146 return this._button;
147 }, 147 },
148 148
149 _nodeChanged: function() 149 _nodeChanged: function()
150 { 150 {
151 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode); 151 var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode);
152 this._button.setEnabled(enabled); 152 this._button.setEnabled(enabled);
153 if (!enabled && this._button.toggled()) 153 if (!enabled && this._button.toggled())
154 WebInspector.ElementsPanel.instance().showToolbarPane(null); 154 WebInspector.ElementsPanel.instance().showToolbarPane(null);
155 } 155 }
156 } 156 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698