Skip to content
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

Closing when clicking outside #29

Closed
celsaad opened this issue Dec 30, 2015 · 1 comment
Closed

Closing when clicking outside #29

celsaad opened this issue Dec 30, 2015 · 1 comment
Labels

Comments

@celsaad
Copy link

celsaad commented Dec 30, 2015

Could you please add support (or maybe an option) to close the sidebar when clicking outside the sidebar?

(there's a neat solution for that here: http://stackoverflow.com/questions/152975/how-to-detect-a-click-outside-an-element/3028037#3028037 )

@IonicaBizau
Copy link
Collaborator

Well, that's really easy as custom code. In fact, in the context of the sidebar we don't know what is the outside. 🔮

An example to get this running on the demo page is (run this in developer tools console):

$("body").children().not(".sidebars").on("click", function () {
   $(".sidebar").trigger("sidebar:close")
});

So, I'm closing this, but if anybody has any ideas, feel free to leave comments. 💭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants