Improve list view and add cookie
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user