From 38d64ea4a14834f4c1e783b911c8ea08720a5978 Mon Sep 17 00:00:00 2001 From: Keplyx Date: Thu, 4 Oct 2018 14:10:23 +0200 Subject: [PATCH] Prevent swipe on images on desktop --- assets/scripts/photosScript.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/assets/scripts/photosScript.js b/assets/scripts/photosScript.js index 04f4236..c11a030 100755 --- a/assets/scripts/photosScript.js +++ b/assets/scripts/photosScript.js @@ -204,10 +204,12 @@ manager.add(Swipe); // Subscribe to the swipe event manager.on('swipe', function(e) { var direction = e.offsetDirection; - if (direction === 4) { // right - displayNext(-1); - } else if (direction === 2) { // left - displayNext(1); + if (isMobile){ + if (direction === 4) { // right + displayNext(-1); + } else if (direction === 2) { // left + displayNext(1); + } } });