Skip to content

Close gallery when swipe vertically#369

Open
t-f-m wants to merge 2 commits into
noelboss:masterfrom
t-f-m:patch-1
Open

Close gallery when swipe vertically#369
t-f-m wants to merge 2 commits into
noelboss:masterfrom
t-f-m:patch-1

Conversation

@t-f-m
Copy link
Copy Markdown

@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.
Comment thread src/featherlight.gallery.js Outdated
.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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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