Bug 1407900 - Part 3: Fix the bug that can't open detail panel if closed detail panel was showing clicked animation. r?pbro draft
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Tue, 17 Oct 2017 10:27:50 +0900
changeset 681126 5907be83de63c610287761dd35dfe666bfa626e2
parent 681125 5ab8face2c7601199705a5cc2e3b0ba4134d1603
child 681127 bcb976e5ff3f2929adb886c4a941333ffbc07d1a
push id84767
push userbmo:dakatsuka@mozilla.com
push dateTue, 17 Oct 2017 01:29:29 +0000
reviewerspbro
bugs1407900
milestone58.0a1
Bug 1407900 - Part 3: Fix the bug that can't open detail panel if closed detail panel was showing clicked animation. r?pbro MozReview-Commit-ID: 6sYhDqtrZ2b
devtools/client/animationinspector/components/animation-timeline.js
--- a/devtools/client/animationinspector/components/animation-timeline.js
+++ b/devtools/client/animationinspector/components/animation-timeline.js
@@ -323,22 +323,25 @@ AnimationsTimeline.prototype = {
     // Unselect an animation which was selected.
     const animationEls = this.rootWrapperEl.querySelectorAll(".animation");
     for (let i = 0; i < animationEls.length; i++) {
       const animationEl = animationEls[i];
       if (!animationEl.classList.contains("selected")) {
         continue;
       }
       if (i === index) {
-        // Already the animation is selected.
-        this.emit("animation-already-selected", this.animations[i]);
-        return;
+        if (this.animationRootEl.classList.contains("animation-detail-visible")) {
+          // Already the animation is selected.
+          this.emit("animation-already-selected", this.animations[i]);
+          return;
+        }
+      } else {
+        animationEl.classList.remove("selected");
+        this.emit("animation-unselected", this.animations[i]);
       }
-      animationEl.classList.remove("selected");
-      this.emit("animation-unselected", this.animations[i]);
       break;
     }
 
     // Add class of animation type to animatedPropertiesEl to display the compositor sign.
     if (!this.animatedPropertiesEl.classList.contains(animation.state.type)) {
       this.animatedPropertiesEl.className =
         `animated-properties ${ animation.state.type }`;
     }