Mount Fluxon UI inside css and js entrypoints

This commit is contained in:
Claudio Ortolina
2025-04-16 10:42:37 +01:00
parent 1ad31b7c30
commit 4eac9f715a
2 changed files with 8 additions and 1 deletions
+7 -1
View File
@@ -21,10 +21,11 @@ import "phoenix_html";
import { Socket } from "phoenix";
import { LiveSocket } from "phoenix_live_view";
import topbar from "../vendor/topbar";
import { Hooks as FluxonHooks, DOM as FluxonDOM } from "fluxon";
import BarcodeScannerHook from "./barcode-scanner";
import confetti from "canvas-confetti";
let Hooks = {};
let Hooks = FluxonHooks;
Hooks.BarcodeScanner = BarcodeScannerHook;
let csrfToken = document
@@ -34,6 +35,11 @@ let liveSocket = new LiveSocket("/live", Socket, {
longPollFallbackMs: 2500,
params: { _csrf_token: csrfToken },
hooks: Hooks,
dom: {
onBeforeElUpdated(from, to) {
FluxonDOM.onBeforeElUpdated(from, to);
},
},
});
// Show progress bar on live navigation and form submits