DevactionUI.Shell.SidebarCookie (devaction_ui v0.3.1)

Copy Markdown View Source

Copies the dui_sidebar cookie, which the DevactionUI.Shell hook writes when the sidebar is collapsed or opened, into the session as "sidebar_open", so the LiveViews render the sidebar in the state the person left it, with no flash on the first paint. Put it in the browser pipeline and read the value with DevactionUI.Shell.on_mount/4:

pipeline :browser do
  plug DevactionUI.Shell.SidebarCookie
end

live_session :app, on_mount: [{DevactionUI.Shell, :sidebar}] do
  ...
end

Summary

Functions

Whether a cookie value leaves the sidebar open: only "rail" collapses it.

Functions

open?(arg1)

@spec open?(String.t() | nil) :: boolean()

Whether a cookie value leaves the sidebar open: only "rail" collapses it.