mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-01-10 00:47:45 +08:00
Use topbar API to specify the delay (#2047)
This commit is contained in:
parent
90ddb573af
commit
bec791c66a
1 changed files with 1 additions and 7 deletions
|
@ -6,17 +6,11 @@ export function registerTopbar() {
|
|||
shadowColor: "rgba(0, 0, 0, .3)",
|
||||
});
|
||||
|
||||
let topBarScheduled = null;
|
||||
|
||||
window.addEventListener("phx:page-loading-start", () => {
|
||||
if (!topBarScheduled) {
|
||||
topBarScheduled = setTimeout(() => topbar.show(), 500);
|
||||
}
|
||||
topbar.show(500);
|
||||
});
|
||||
|
||||
window.addEventListener("phx:page-loading-stop", () => {
|
||||
clearTimeout(topBarScheduled);
|
||||
topBarScheduled = null;
|
||||
topbar.hide();
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue