-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support for closing on click and edge slide in options. #10
Conversation
Hmm, not sure about I really like document.querySelector('.slideout-panel').addEventListener('click', function(eve) {
if (slideout.isOpen()) {
eve.preventDefault();
slideout.close();
}
}); |
I do agree about closeOnClick as it's rather simple to implement the feature if they wish so. As for grabWidth, I feel it's necessary since the menu will slide out with any horizontal scrolling in the panel content. It's also common behaviour with most off canvas menus (or at least the ones I have used) for the menu to only slide out when swiped from the edge. |
{Arch Rom} (Phonetics) , for this phone and the line between.thanks |
@pazguille I'm actually the other way around, I dislike the +1 to this PR though, it fixes a lot of issues when you have sliding carousels in your page etc. Also helps prevents the menu starting to open sometimes when your scrolling. |
@pazguille any news on if this PR will be accepted or left open forever? ;D |
vote! |
@pazguille PLEASE can you look at this and make a decision? I find it so frustrating (and my users) that the menu can be triggered from anywhere on the page. There should be an option to confine it to only open within X amount of pixels from the screen, which this PR does perfectly. |
the code is from Mango#10
the code is from Mango#10
the code is from Mango#10
+1 |
1 similar comment
+1 |
It's common in mobile apps for the menu to only slide in when dragged from the edge of the screen (not the whole screen). The new grabWidth option will allow configuring what threshold this is. If not specified, the behaviour will revert back to how it currently is. I have also added an option to allow closing the menu when it's opened (closeOnClick) by simply clicking the panel element.