mirror of
https://github.com/zen-browser/components.git
synced 2025-07-07 23:49:58 +02:00
Refactor ZenGlanceManager.mjs to improve animation handling and visibility toggling
This commit is contained in:
parent
b1b3cb8555
commit
16fc60e1f0
1 changed files with 24 additions and 12 deletions
|
@ -130,7 +130,7 @@
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.browserWrapper.setAttribute("animate-end", true);
|
this.browserWrapper.setAttribute("animate-end", true);
|
||||||
this.#animating = false;
|
this.#animating = false;
|
||||||
}, 500);
|
}, 400);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,15 +140,27 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
if (noAnimation) {
|
if (noAnimation) {
|
||||||
this.overlay.setAttribute("hidden", true);
|
this.overlay.style.opacity = 0;
|
||||||
this.overlay.removeAttribute("fade-out");
|
this.overlay.visivility = "collapse";
|
||||||
this.browserWrapper.removeAttribute("animate");
|
window.requestAnimationFrame(() => {
|
||||||
this.browserWrapper.removeAttribute("animate-end");
|
this.overlay.setAttribute("hidden", true);
|
||||||
this.#currentBrowser?.remove();
|
this.overlay.removeAttribute("fade-out");
|
||||||
this.#currentTab?.remove();
|
this.browserWrapper.removeAttribute("animate");
|
||||||
this.#currentBrowser = null;
|
this.browserWrapper.removeAttribute("animate-end");
|
||||||
this.#currentTab = null;
|
|
||||||
this.originalOverlayParent.appendChild(this.overlay);
|
setTimeout(() => {
|
||||||
|
this.#currentBrowser?.remove();
|
||||||
|
this.#currentTab?.remove();
|
||||||
|
this.#currentBrowser = null;
|
||||||
|
this.#currentTab = null;
|
||||||
|
this.originalOverlayParent.appendChild(this.overlay);
|
||||||
|
|
||||||
|
this.overlay.style.opacity = 1;
|
||||||
|
this.overlay.visivility = "visible";
|
||||||
|
|
||||||
|
this.#animating = false;
|
||||||
|
}, 500);
|
||||||
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -205,11 +217,11 @@
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.animatingFullOpen = false;
|
this.animatingFullOpen = false;
|
||||||
this.closeGlance({ noAnimation: true });
|
this.closeGlance({ noAnimation: true });
|
||||||
}, 400);
|
}, 600);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}, 200);
|
}, 300);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue