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

Side by Side Diff: third_party/WebKit/Source/devtools/front_end/elements/ClassesPaneWidget.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.ClassesPaneWidget = function(toolbarItem) 10 WebInspector.ClassesPaneWidget = function(toolbarItem)
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/devtools/front_end/elements/ElementStatePaneWidget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698