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

Unified Diff: Source/devtools/front_end/StylesSidebarPane.js

Issue 182113004: DevTools: Get rid of Element.prototype.enableStyleClass (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebaselined Created 6 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/devtools/front_end/StatusBarButton.js ('k') | Source/devtools/front_end/ThreadsToolbar.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/StylesSidebarPane.js
diff --git a/Source/devtools/front_end/StylesSidebarPane.js b/Source/devtools/front_end/StylesSidebarPane.js
index 247eb6a7033b9fe41fb048441a8ccff0e8565fc1..c9927ac77bd98ac1130e0bd02035d450ff2fcbbb 100644
--- a/Source/devtools/front_end/StylesSidebarPane.js
+++ b/Source/devtools/front_end/StylesSidebarPane.js
@@ -73,7 +73,7 @@ WebInspector.StylesSidebarPane = function(computedStylePane, setPseudoClassCallb
WebInspector.settings.showUserAgentStyles.addChangeListener(this._showUserAgentStylesSettingChanged.bind(this));
WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTreeModel.EventTypes.FrameResized, this._frameResized, this);
this.element.classList.add("styles-pane");
- this.element.enableStyleClass("show-user-styles", WebInspector.settings.showUserAgentStyles.get());
+ this.element.classList.toggle("show-user-styles", WebInspector.settings.showUserAgentStyles.get());
this.element.addEventListener("mousemove", this._mouseMovedOverElement.bind(this), false);
document.body.addEventListener("keydown", this._keyDown.bind(this), false);
document.body.addEventListener("keyup", this._keyUp.bind(this), false);
@@ -191,8 +191,8 @@ WebInspector.StylesSidebarPane.prototype = {
return;
var hasPseudoType = !!this.node.pseudoType();
- this._elementStateButton.enableStyleClass("hidden", hasPseudoType);
- this._elementStatePane.enableStyleClass("expanded", !hasPseudoType && this._elementStateButton.classList.contains("toggled"));
+ this._elementStateButton.classList.toggle("hidden", hasPseudoType);
+ this._elementStatePane.classList.toggle("expanded", !hasPseudoType && this._elementStateButton.classList.contains("toggled"));
var nodePseudoState = this._forcedPseudoClasses;
if (!nodePseudoState)
@@ -761,8 +761,8 @@ WebInspector.StylesSidebarPane.prototype = {
var buttonToggled = !this._elementStateButton.classList.contains("toggled");
if (buttonToggled)
this.expand();
- this._elementStateButton.enableStyleClass("toggled", buttonToggled);
- this._elementStatePane.enableStyleClass("expanded", buttonToggled);
+ this._elementStateButton.classList.toggle("toggled", buttonToggled);
+ this._elementStatePane.classList.toggle("expanded", buttonToggled);
},
_createElementStatePane: function()
@@ -825,7 +825,7 @@ WebInspector.StylesSidebarPane.prototype = {
_showUserAgentStylesSettingChanged: function(event)
{
var showStyles = /** @type {boolean} */ (event.data);
- this.element.enableStyleClass("show-user-styles", showStyles);
+ this.element.classList.toggle("show-user-styles", showStyles);
},
willHide: function()
« no previous file with comments | « Source/devtools/front_end/StatusBarButton.js ('k') | Source/devtools/front_end/ThreadsToolbar.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698