-
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
Allow opening menu by swiping from only far left/right #117
base: master
Are you sure you want to change the base?
Conversation
This would be very useful! +1 |
@pazguille any news on this? I'm currently maintaining a separate fork just to have this kind of feature, bit a pain tbh. As I reported in issue #59 it will be good to have some form of I know you can can get around this by using the |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 + 1 +1 |
I needed that feature to mimic native mobile apps menu. Since I didn't want to maintain a fork I used the following code to update slideout._preventOpen. I reused _tolerance for the size of the padding, since it was so tiny. let panel = document.getElementById('panel');
let slideout = new Slideout({
'panel': panel,
'menu': document.getElementById('sideMenu'),
'padding': 256,
'tolerance': 50
});
panel.addEventListener('touchstart', function(eve) {
let offset = eve.touches[0].pageX;
if (slideout._orientation !== 1) {
offset = window.innerWidth - offset;
}
slideout._preventOpen = slideout._preventOpen || (offset > slideout._tolerance && !slideout.isOpen());
}); |
I had issues with the swipe slideout when there is a horizontal scrolling div, see issue #58 and issue #59.
This PR is based on PR #10 which has been closed and is no longer available.
It works for me. Any enhancements or ideas are welcome.
Would like to see this been merged :)