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

Unified Diff: Source/devtools/front_end/animation/AnimationControlPane.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/ElementStatePaneWidget.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/devtools/front_end/animation/AnimationControlPane.js
diff --git a/Source/devtools/front_end/animation/AnimationControlPane.js b/Source/devtools/front_end/animation/AnimationControlPane.js
index f6b81dec92f4d38c4b4d9fbee9cc81683e3ec0c4..cf78bf82863a2a4a8c72ceb9ae585295b92a9e35 100644
--- a/Source/devtools/front_end/animation/AnimationControlPane.js
+++ b/Source/devtools/front_end/animation/AnimationControlPane.js
@@ -81,10 +81,8 @@ WebInspector.AnimationControlPane.prototype = {
*/
onNodeChanged: function(node)
{
- if (!node) {
- this.detach();
+ if (!node)
return;
- }
if (this._target)
this._target.resourceTreeModel.removeEventListener(WebInspector.ResourceTreeModel.EventTypes.MainFrameNavigated, this._updateAnimationsPlaybackRate, this);
@@ -110,34 +108,48 @@ WebInspector.AnimationControlPane.ButtonProvider = function()
}
WebInspector.AnimationControlPane.ButtonProvider.prototype = {
- _animationTimelineModeClick: function()
+ /**
+ * @param {boolean} toggleOn
+ */
+ _toggleAnimationTimelineMode: function(toggleOn)
{
if (!this._animationTimeline)
this._animationTimeline = new WebInspector.AnimationTimeline();
- this._button.setToggled(!this._animationTimeline.isShowing());
+ this._button.setToggled(toggleOn);
var elementsPanel = WebInspector.ElementsPanel.instance();
- elementsPanel.setWidgetBelowDOM(!this._animationTimeline.isShowing() ? this._animationTimeline : null);
+ elementsPanel.setWidgetBelowDOM(toggleOn ? this._animationTimeline : null);
},
- _animationControlPaneModeClick: function()
+ /**
+ * @param {boolean} toggleOn
+ */
+ _toggleAnimationControlPaneMode: function(toggleOn)
{
if (!this._animationsControlPane)
this._animationsControlPane = new WebInspector.AnimationControlPane(this.item());
var stylesSidebarPane = WebInspector.ElementsPanel.instance().sidebarPanes.styles;
- stylesSidebarPane.showToolbarPane(!this._animationsControlPane.isShowing() ? this._animationsControlPane : null);
+ stylesSidebarPane.showToolbarPane(toggleOn ? this._animationsControlPane : null);
},
_clicked: function()
{
if (Runtime.experiments.isEnabled("animationInspection"))
- this._animationTimelineModeClick();
+ this._toggleAnimationTimelineMode(!this._button.toggled());
else
- this._animationControlPaneModeClick();
+ this._toggleAnimationControlPaneMode(!this._button.toggled());
},
_nodeChanged: function()
{
- this._button.setEnabled(!!WebInspector.context.flavor(WebInspector.DOMNode));
+ var enabled = !!WebInspector.context.flavor(WebInspector.DOMNode);
+ this._button.setEnabled(enabled);
+ if (enabled)
+ return;
+
+ if (Runtime.experiments.isEnabled("animationInspection"))
+ this._toggleAnimationTimelineMode(false);
+ else
+ this._toggleAnimationControlPaneMode(false);
},
/**
« no previous file with comments | « no previous file | Source/devtools/front_end/elements/ElementStatePaneWidget.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698