From bec791c66a5479fabbe22edf7f505caf14837287 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Clemens=20M=EF=BF=BDller?= Date: Sun, 9 Jul 2023 14:11:42 +0200 Subject: [PATCH] Use topbar API to specify the delay (#2047) --- assets/js/events.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/assets/js/events.js b/assets/js/events.js index f9d256124..9f7fb52bf 100644 --- a/assets/js/events.js +++ b/assets/js/events.js @@ -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(); }); }