Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/featherlight.gallery.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,9 @@
if (self._swiper) {
self._swiper
.off('swipeleft', self._swipeleft) /* See http://stackoverflow.com/questions/17367198/hammer-js-cant-remove-event-listener */
.off('swiperight', self._swiperight);
.off('swiperight', self._swiperight)
.off('swipeup', self._swipeup)
.off('swipedown', self._swipedown);
self._swiper = null;
}
return _super(event);
Expand All @@ -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.

.on('swipedown', self._swipedown = function() { $.featherlight.close(event); });

self.$instance
.addClass(this.namespace+'-swipe-aware', swipeAwareConstructor);
Expand Down