Allow opening menu by swiping from only far left/right#117
Allow opening menu by swiping from only far left/right#117swelther wants to merge 4 commits intoMango:masterfrom
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 :)