Improve list view and add cookie

This commit is contained in:
2023-11-27 16:49:59 +00:00
committed by Daniel Patterson
parent e31db2f5e8
commit cb7c15c345
5 changed files with 129 additions and 59 deletions

View File

@@ -30,6 +30,10 @@ 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())
window.addEventListener("toggle_view_state", e => {
document.cookie = `user_display=${e.detail.grid ? "grid" : "list"}; SameSite=lax;`
})
// connect if there are any LiveViews on the page
liveSocket.connect()