diff --git a/README.md b/README.md index dc99355..3dd3e67 100644 --- a/README.md +++ b/README.md @@ -162,7 +162,8 @@ Turn on/off bubbles. *** # Touch support -- swipe right and left to change images +- swipe right for prev +- swipe left for next - doubletap to close gallery > Touch will be enabled only if `hammer.js` file is added. diff --git a/dist/ng-image-gallery.js b/dist/ng-image-gallery.js index c8f2578..10ed131 100644 --- a/dist/ng-image-gallery.js +++ b/dist/ng-image-gallery.js @@ -312,12 +312,12 @@ // Swipe events if(window.Hammer){ var hammerElem = new Hammer(elem[0]); - hammerElem.on('swipeleft', function(ev){ + hammerElem.on('swiperight', function(ev){ $timeout(function(){ scope.methods.prev(); }); }); - hammerElem.on('swiperight', function(ev){ + hammerElem.on('swipeleft', function(ev){ $timeout(function(){ scope.methods.next(); }); diff --git a/dist/ng-image-gallery.min.js b/dist/ng-image-gallery.min.js index c5f6ac0..baf4555 100644 --- a/dist/ng-image-gallery.min.js +++ b/dist/ng-image-gallery.min.js @@ -1,2 +1,2 @@ -!function(){"use strict";var e={enter:13,esc:27,left:37,right:39};angular.module("thatisuday.ng-image-gallery",["ngAnimate"]).directive("ngImageGallery",["$timeout","$document","$q",function(i,n,a){return{replace:!0,transclude:!1,restrict:"AE",scope:{images:"=",methods:"=?",thumbnails:"=?",inline:"=?",bubbles:"=?",imgBubbles:"=?",bgClose:"=?",onOpen:"&?",onClose:"&?"},template:'