[SOLVED] Close left panel when click a link on it


#1

Hello

I’m developing an app from single view template. In the left panel, I placed a menu but when I click an item the page shows but the left panel mantains open.

Which is the best manner of doing this? I need the left panel to close when click a link


#2

Hi,
According to the doc

Control Panel With Links
It is possible to open and close required panel (if you have them in DOM) using special classes and data attributes on links:

To open panel we need to add panel-open class to any HTML element (prefered to link)

To close panel we need to add panel-close class to any HTML element (prefered to link)

If you have two panels in app, such link will open/close Left panel by default

If you want to specify which panel should opened/closed, then it could be done via additional data-panel="left attribute on this HTML element

so just add the class in your link

<a class='my-class panel-close' href='myawesomepage'>My awesome page </a>

#3

That’s it! Thanks a lot!