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

Side by Side Diff: Source/devtools/front_end/elements/StylesSidebarPane.js

Issue 1176413002: Devtools: Fix disabled element state pane button after reloading (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/elements/ElementStatePaneWidget.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2007 Apple Inc. All rights reserved. 2 * Copyright (C) 2007 Apple Inc. All rights reserved.
3 * Copyright (C) 2009 Joseph Pecoraro 3 * Copyright (C) 2009 Joseph Pecoraro
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions 6 * modification, are permitted provided that the following conditions
7 * are met: 7 * are met:
8 * 8 *
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 24 matching lines...) Expand all
35 WebInspector.StylesSidebarPane = function(requestShowCallback) 35 WebInspector.StylesSidebarPane = function(requestShowCallback)
36 { 36 {
37 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ; 37 WebInspector.ElementsSidebarPane.call(this, WebInspector.UIString("Styles")) ;
38 38
39 this.element.addEventListener("contextmenu", this._contextMenuEventFired.bin d(this), true); 39 this.element.addEventListener("contextmenu", this._contextMenuEventFired.bin d(this), true);
40 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this)); 40 WebInspector.moduleSetting("colorFormat").addChangeListener(this.update.bind (this));
41 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this)); 41 WebInspector.moduleSetting("textEditorIndent").addChangeListener(this.update .bind(this));
42 42
43 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", this.element); 43 var toolbar = new WebInspector.ExtensibleToolbar("styles-sidebarpane-toolbar ", this.element);
44 toolbar.element.classList.add("styles-pane-toolbar"); 44 toolbar.element.classList.add("styles-pane-toolbar");
45 this._currentToolbarPane = null;
45 46
46 this._requestShowCallback = requestShowCallback; 47 this._requestShowCallback = requestShowCallback;
47 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container"); 48 var toolbarPaneContainer = this.element.createChild("div", "styles-sidebar-t oolbar-pane-container");
48 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane"); 49 this._toolbarPaneElement = toolbarPaneContainer.createChild("div", "styles-s idebar-toolbar-pane");
49 this._sectionsContainer = this.element.createChild("div"); 50 this._sectionsContainer = this.element.createChild("div");
50 51
51 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper(); 52 this._stylesPopoverHelper = new WebInspector.StylesPopoverHelper();
52 53
53 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa ultCSSFormatter()); 54 this._linkifier = new WebInspector.Linkifier(new WebInspector.Linkifier.Defa ultCSSFormatter());
54 55
(...skipping 3130 matching lines...) Expand 10 before | Expand all | Expand 10 after
3185 * @param {!WebInspector.ToolbarItem} toolbarItem 3186 * @param {!WebInspector.ToolbarItem} toolbarItem
3186 */ 3187 */
3187 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget = function(toolbarItem) 3188 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget = function(toolbarItem)
3188 { 3189 {
3189 WebInspector.Widget.call(this); 3190 WebInspector.Widget.call(this);
3190 this._toolbarItem = toolbarItem; 3191 this._toolbarItem = toolbarItem;
3191 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this); 3192 WebInspector.context.addFlavorChangeListener(WebInspector.DOMNode, this._nod eChanged, this);
3192 } 3193 }
3193 3194
3194 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype = { 3195 WebInspector.StylesSidebarPane.BaseToolbarPaneWidget.prototype = {
3195 /**
3196 * @return {!WebInspector.ToolbarItem}
3197 */
3198 toolbarItem: function()
3199 {
3200 return this._toolbarItem;
3201 },
3202
3203 _nodeChanged: function() 3196 _nodeChanged: function()
3204 { 3197 {
3205 if (!this.isShowing()) 3198 if (!this.isShowing())
3206 return; 3199 return;
3207 3200
3208 var elementNode = WebInspector.SharedSidebarModel.elementNode(WebInspect or.context.flavor(WebInspector.DOMNode)); 3201 var elementNode = WebInspector.SharedSidebarModel.elementNode(WebInspect or.context.flavor(WebInspector.DOMNode));
3209 this.onNodeChanged(elementNode); 3202 this.onNodeChanged(elementNode);
3210 }, 3203 },
3211 3204
3212 /** 3205 /**
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
3261 3254
3262 /** 3255 /**
3263 * @override 3256 * @override
3264 * @return {?WebInspector.ToolbarItem} 3257 * @return {?WebInspector.ToolbarItem}
3265 */ 3258 */
3266 item: function() 3259 item: function()
3267 { 3260 {
3268 return this._button; 3261 return this._button;
3269 } 3262 }
3270 } 3263 }
OLDNEW
« no previous file with comments | « Source/devtools/front_end/elements/ElementStatePaneWidget.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698