Ensure Javascript factory method executes only once
I am using Tabler Bootstrap template and HTMX. As can be seen in the vertical layout (select it from the ‘Layout’ menu) of the Tabler preview, on reducing the width of the browser window, the left sidebar collapses and a toggler button with a hamburger icon is displayed to show/hide the sidebar. When using HTMX history (hx-push-url
) and HTMX out of band (hx-swap-oob
) features for a link, on pressing the back browser button, the toggler button stops working: the sidebar is shown but then is not hidden.