From 5d631354e5ce818ab2917a4075d6418e7889672f Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Wed, 30 Oct 2024 17:16:24 +0100 Subject: [PATCH] Refactor ZenGlanceManager.mjs to remove unnecessary attribute and improve animation handling --- src/ZenGlanceManager.mjs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/ZenGlanceManager.mjs b/src/ZenGlanceManager.mjs index 443a27c..05b97ab 100644 --- a/src/ZenGlanceManager.mjs +++ b/src/ZenGlanceManager.mjs @@ -99,6 +99,7 @@ this.browserWrapper.removeAttribute("animate-end"); this.browserWrapper.removeAttribute("animate-full"); this.browserWrapper.removeAttribute("animate-full-end"); + this.browserWrapper.removeAttribute("has-finished-animation"); const url = data.url; const currentTab = gBrowser.selectedTab; @@ -130,6 +131,7 @@ this.#animating = true; setTimeout(() => { this.browserWrapper.setAttribute("animate-end", true); + this.browserWrapper.setAttribute("has-finished-animation", true); this.#animating = false; }, 400); }); @@ -140,6 +142,7 @@ return; } + this.browserWrapper.removeAttribute("has-finished-animation"); if (noAnimation) { this.overlay.style.opacity = 0; this.overlay.visivility = "collapse"; @@ -208,6 +211,7 @@ this.animatingFullOpen = true; + this.browserWrapper.removeAttribute("has-finished-animation"); this.browserWrapper.setAttribute("animate-full", true); setTimeout(() => { window.requestAnimationFrame(() => {