New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Request: Auto close all folders #57
Comments
I'm not sure this is common enough to be part of the core library. For now you could override GUI.prototype.open() to close "sibling" folders. I could see the folders broadcasting open and close events at some point in the future, if there's enough need. |
Thanks for the reply and I will look at the GUI.prototype.open |
Following the prototype idea, however, I could not get it to work. My code is like: GUI.prototype.open = function ( open = true ) { Any ideas? |
Yes, that's bad advice I'm giving above. Most likely this isn't working because we're actually calling the For now, you could try putting your logic in the setter function of the example here: #67 (comment) — that's a way of observing any change to There will be a better mechanism for listening to folder open and close events in an upcoming release. |
Thanks for the replay, but I did not immediately see how I can use the sample code to achieve the effect, as illustrated here: http://cbfranca.github.io/vertical-responsive-menu/demos/demo.html# |
Hi there, I just published version 0.18 which has a new method called gui.onOpenClose. You can use that to listen for folder open/close events and then close sibling folders in the callback. |
That's perfect, thank you ! |
Would it be possible to add a function so that when you click on a folder all other folders in the Gui close automatically?
Just an idea for larger GUi's.
The text was updated successfully, but these errors were encountered: