Add title and topbar

This commit is contained in:
Paul-Henri Froidmont 2025-08-27 03:09:14 +02:00
parent 124239925d
commit fca87a4263
Signed by: phfroidmont
GPG key ID: BE948AFD7E7873BE
5 changed files with 14 additions and 10 deletions

View file

@ -1,7 +1,6 @@
import { Socket } from "phoenix"
import { LiveSocket } from "phoenix_live_view"
// import topbar from "../vendor/topbar"
// import Calendar from "./hooks/calendar"
import topbar from "topbar"
// let csrfToken =
// document.querySelector("meta[name='csrf-token']").getAttribute("content")
@ -12,9 +11,9 @@ let liveSocket = new LiveSocket("/live", Socket, {
});
// Show progress bar on live navigation and form submits
// topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" })
// window.addEventListener("phx:page-loading-start", info => topbar.delayedShow(200))
// window.addEventListener("phx:page-loading-stop", info => topbar.hide())
topbar.config({ barColors: { 0: "#29d" }, shadowColor: "rgba(0, 0, 0, .3)" })
window.addEventListener("phx:page-loading-start", _info => topbar.show(300))
window.addEventListener("phx:page-loading-stop", _info => topbar.hide())
// connect if there are any LiveViews on the page
liveSocket.connect()