Fixed an error when swiping and removed unnecessary detection

This commit is contained in:
Tobias Reich 2014-04-01 22:39:59 +02:00
parent a92a8e5e42
commit 605ef84c0b
3 changed files with 8 additions and 6 deletions

View File

@ -127,9 +127,9 @@ $(document).ready(function(){
}) })
/* Swipe on mobile */ /* Swipe on mobile */
.swipe().on('swipeStart', function() { swipe.start($("#image")) }) .swipe().on('swipeStart', function() { if (visible.photo()) swipe.start($("#image")) })
.swipe().on('swipeMove', function(e) { swipe.move(e.swipe) }) .swipe().on('swipeMove', function(e) { if (visible.photo()) swipe.move(e.swipe) })
.swipe().on('swipeEnd', function(e) { swipe.stop(e.swipe, photo.previous, photo.next) }); .swipe().on('swipeEnd', function(e) { if (visible.photo()) swipe.stop(e.swipe, photo.previous, photo.next) });
} }

View File

@ -26,6 +26,8 @@ swipe = {
console.log(e); console.log(e);
if (swipe.obj===null) return false;
swipe.offset = -1 * e.x; swipe.offset = -1 * e.x;
swipe.obj.css({ swipe.obj.css({

File diff suppressed because one or more lines are too long