From 3464cf5b663bb0a1f1f6353c30bf9d45668ca249 Mon Sep 17 00:00:00 2001 From: Graham McIntire Date: Sat, 5 Jul 2025 13:00:34 -0500 Subject: [PATCH] js tweak --- assets/js/app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/assets/js/app.js b/assets/js/app.js index 3220c84..6145573 100644 --- a/assets/js/app.js +++ b/assets/js/app.js @@ -20,7 +20,7 @@ import "phoenix_html"; // Establish Phoenix Socket and LiveView configuration. import { Socket } from "phoenix"; import { LiveSocket } from "phoenix_live_view"; -import topbar from "../vendor/topbar.js"; +import "../vendor/topbar.js"; import "../vendor/oms.min.js"; let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content"); @@ -179,7 +179,7 @@ let liveSocket = new LiveSocket("/live", Socket, { }); // Show progress bar on live navigation and form submits -topbar.config({ +window.topbar.config({ barColors: { 0: "hsl(var(--p))", // DaisyUI primary color 0.5: "hsl(var(--s))", // DaisyUI secondary color @@ -188,8 +188,8 @@ topbar.config({ shadowColor: "rgba(0, 0, 0, .3)", barThickness: 3 }); -window.addEventListener("phx:page-loading-start", (info) => topbar.delayedShow(200)); -window.addEventListener("phx:page-loading-stop", (info) => topbar.hide()); +window.addEventListener("phx:page-loading-start", (info) => window.topbar.show(200)); +window.addEventListener("phx:page-loading-stop", (info) => window.topbar.hide()); // connect if there are any LiveViews on the page liveSocket.connect();