The event handler is working on every close. But scrollTop() is always showing 0 no matter where the panel has been scrolled to. Clearly, it’s not the .panel-left that has scrolled. What item under .panel-left has the scrolling?
Similarly, when the panel is closed, I’d like to force the next re-open to the topmost (back) level. How do I force things back to the topmost view of the panel?
Thank you for that suggestion - I tried it but it had no effect (adding .page-content). I’ll spend some time inspecting the nodes to find which part needs to have its scrollTop reset. If I find it, I’ll post it back for others. The old archive had a couple of questions about scrollTop like this too so it’s not something obvious for people starting out like me.
It depends on what you have in left panel. If you have there View -> Pages -> Page structure then it is should be $('.panel-left .page-content').scrollTop(0), if you have nothing else scrollable then $('.panel-left').scrollTop(0)
Or issue can be because when it is closed, it has display:none. In this case browser may not set scrollTop properly because the element is invisible and has no sizes. Then just change your logic to panel:open event: