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
--- 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 }`;
}