Add eventlistener for change of day/night mode

And add a static js folder for js-files apart from the asset pipeline.
This commit is contained in:
Thelonius Kort
2023-02-05 20:14:06 +01:00
parent ab2e8ae816
commit ba2949a3bd
6 changed files with 15 additions and 19 deletions

View File

@ -22,7 +22,8 @@ import {Socket} from "phoenix"
import {LiveSocket} from "phoenix_live_view"
import topbar from "../vendor/topbar"
import {DarkModeHook} from './dark-mode'
import {DarkModeHook} from './dark-mode-widget'
let csrfToken = document.querySelector("meta[name='csrf-token']").getAttribute("content")
let liveSocket = new LiveSocket("/live", Socket, {
params: {_csrf_token: csrfToken},
@ -42,4 +43,3 @@ liveSocket.connect()
// >> liveSocket.enableLatencySim(1000) // enabled for duration of browser session
// >> liveSocket.disableLatencySim()
window.liveSocket = liveSocket