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

Close gallery when swipe vertically #369

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

t-f-m
Copy link

@t-f-m t-f-m commented Sep 26, 2018

Add feature(gallery):
jquery.detect_swipe.js and hammer also support swipeup and swipedown.

Add feature(gallery):
  jquery.detect_swipe.js and hammer also support swipeup and swipedown.
@@ -55,7 +57,9 @@
if (swipeAwareConstructor) {
self._swiper = swipeAwareConstructor(self.$instance)
.on('swipeleft', self._swipeleft = function() { self.$instance.trigger('next'); })
.on('swiperight', self._swiperight = function() { self.$instance.trigger('previous'); });
.on('swiperight', self._swiperight = function() { self.$instance.trigger('previous'); })
.on('swipeup', self._swipeup = function() { $.featherlight.close(event); })
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be function(event) { ... }, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

right. this is my mistake.

@marcandre
Copy link
Collaborator

Sounds like a a great idea.
I'm just wondering if there should be a setting to avoid the behavior though. I'm thinking of featherlights to show those long and ridiculous User Agreements and stuff that might need to scroll up/down. If I'm not mistaken, listening for swipeup/down will disable the scrolling.

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

Successfully merging this pull request may close these issues.

2 participants