Bug 1431573 - Part 0: Make functions in animation.js alphabetize. r?gl draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 13 Mar 2018 14:31:09 +0900
changeset 766603 66f74d4172588faeaa87ae48a363222d2ec76910
parent 766597 6ff60a083701d08c52702daf50f28e8f46ae3a1c
child 766604 05152d1f2cff3a098e5ed045a43b12225e8133d5
push id102370
push userbmo:dakatsuka@mozilla.com
push dateTue, 13 Mar 2018 06:01:02 +0000
reviewersgl
bugs1431573
milestone61.0a1
Bug 1431573 - Part 0: Make functions in animation.js alphabetize. r?gl MozReview-Commit-ID: BbTjVnc5qqv
devtools/client/inspector/animation/animation.js
--- a/devtools/client/inspector/animation/animation.js
+++ b/devtools/client/inspector/animation/animation.js
@@ -186,16 +186,45 @@ class AnimationInspector {
   }
 
   isPanelVisible() {
     return this.inspector && this.inspector.toolbox && this.inspector.sidebar &&
            this.inspector.toolbox.currentToolId === "inspector" &&
            this.inspector.sidebar.getCurrentTabID() === "newanimationinspector";
   }
 
+  onElementPickerStarted() {
+    this.inspector.store.dispatch(updateElementPickerEnabled(true));
+  }
+
+  onElementPickerStopped() {
+    this.inspector.store.dispatch(updateElementPickerEnabled(false));
+  }
+
+  onSidebarSelect() {
+    this.update();
+    this.onSidebarResized(null, this.inspector.getSidebarSize());
+  }
+
+  onSidebarResized(type, size) {
+    if (!this.isPanelVisible()) {
+      return;
+    }
+
+    this.inspector.store.dispatch(updateSidebarSize(size));
+  }
+
+  selectAnimation(animation) {
+    this.inspector.store.dispatch(updateSelectedAnimation(animation));
+  }
+
+  setDetailVisibility(isVisible) {
+    this.inspector.store.dispatch(updateDetailVisibility(isVisible));
+  }
+
   /**
    * Returns simulatable animation by given parameters.
    * The returned animation is implementing Animation interface of Web Animation API.
    * https://drafts.csswg.org/web-animations/#the-animation-interface
    *
    * @param {Array} keyframes
    *        e.g. [{ opacity: 0 }, { opacity: 1 }]
    * @param {Object} effectTiming
@@ -255,40 +284,11 @@ class AnimationInspector {
       this.inspector.store.dispatch(updateAnimations(animations));
       this.animations = animations;
       // If number of displayed animations is one, we select the animation automatically.
       this.selectAnimation(animations.length === 1 ? animations[0] : null);
     }
 
     done();
   }
-
-  selectAnimation(animation) {
-    this.inspector.store.dispatch(updateSelectedAnimation(animation));
-  }
-
-  setDetailVisibility(isVisible) {
-    this.inspector.store.dispatch(updateDetailVisibility(isVisible));
-  }
-
-  onElementPickerStarted() {
-    this.inspector.store.dispatch(updateElementPickerEnabled(true));
-  }
-
-  onElementPickerStopped() {
-    this.inspector.store.dispatch(updateElementPickerEnabled(false));
-  }
-
-  onSidebarSelect() {
-    this.update();
-    this.onSidebarResized(null, this.inspector.getSidebarSize());
-  }
-
-  onSidebarResized(type, size) {
-    if (!this.isPanelVisible()) {
-      return;
-    }
-
-    this.inspector.store.dispatch(updateSidebarSize(size));
-  }
 }
 
 module.exports = AnimationInspector;