mirror of
https://github.com/zen-browser/components.git
synced 2025-07-08 00:10:01 +02:00
Refactor ZenGlanceManager.mjs to remove unnecessary attribute and improve animation handling
This commit is contained in:
parent
5daa3ffa53
commit
5d631354e5
1 changed files with 4 additions and 0 deletions
|
@ -99,6 +99,7 @@
|
||||||
this.browserWrapper.removeAttribute("animate-end");
|
this.browserWrapper.removeAttribute("animate-end");
|
||||||
this.browserWrapper.removeAttribute("animate-full");
|
this.browserWrapper.removeAttribute("animate-full");
|
||||||
this.browserWrapper.removeAttribute("animate-full-end");
|
this.browserWrapper.removeAttribute("animate-full-end");
|
||||||
|
this.browserWrapper.removeAttribute("has-finished-animation");
|
||||||
|
|
||||||
const url = data.url;
|
const url = data.url;
|
||||||
const currentTab = gBrowser.selectedTab;
|
const currentTab = gBrowser.selectedTab;
|
||||||
|
@ -130,6 +131,7 @@
|
||||||
this.#animating = true;
|
this.#animating = true;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.browserWrapper.setAttribute("animate-end", true);
|
this.browserWrapper.setAttribute("animate-end", true);
|
||||||
|
this.browserWrapper.setAttribute("has-finished-animation", true);
|
||||||
this.#animating = false;
|
this.#animating = false;
|
||||||
}, 400);
|
}, 400);
|
||||||
});
|
});
|
||||||
|
@ -140,6 +142,7 @@
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.browserWrapper.removeAttribute("has-finished-animation");
|
||||||
if (noAnimation) {
|
if (noAnimation) {
|
||||||
this.overlay.style.opacity = 0;
|
this.overlay.style.opacity = 0;
|
||||||
this.overlay.visivility = "collapse";
|
this.overlay.visivility = "collapse";
|
||||||
|
@ -208,6 +211,7 @@
|
||||||
|
|
||||||
this.animatingFullOpen = true;
|
this.animatingFullOpen = true;
|
||||||
|
|
||||||
|
this.browserWrapper.removeAttribute("has-finished-animation");
|
||||||
this.browserWrapper.setAttribute("animate-full", true);
|
this.browserWrapper.setAttribute("animate-full", true);
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue