Browse Source

Limited swipe to mobile

Tobias Reich 11 years ago
parent
commit
9fbd2e183b
2 changed files with 16 additions and 13 deletions
  1. 0 0
      assets/build/main.js
  2. 16 13
      assets/js/init.js

File diff suppressed because it is too large
+ 0 - 0
assets/build/main.js


+ 16 - 13
assets/js/init.js

@@ -109,20 +109,23 @@ $(document).ready(function(){
 		});
 	}
 
-	$(document).swipe()
-		.on("swipeStart", function(e) {
-			swipe.start($("#image"));
-		})
-		.on('swipeMove', function(e) {
-			swipe.move(e.swipe);
-		})
-		.on('swipeEnd', function(e) {
-			swipe.stop(e.swipe, function() {
-				$("#imageview .arrow_wrapper.previous").click();
-			}, function() {
-				$("#imageview .arrow_wrapper.next").click();
+	/* Swipe on mobile */
+	if (mobileBrowser()) {
+		$(document).swipe()
+			.on("swipeStart", function(e) {
+				swipe.start($("#image"));
+			})
+			.on('swipeMove', function(e) {
+				swipe.move(e.swipe);
+			})
+			.on('swipeEnd', function(e) {
+				swipe.stop(e.swipe, function() {
+					$("#imageview .arrow_wrapper.previous").trigger('touchend');
+				}, function() {
+					$("#imageview .arrow_wrapper.next").trigger('touchend');
+				});
 			});
-		});
+	}
 
 	/* Document */
 	$(document)

Some files were not shown because too many files changed in this diff