]> git.ipfire.org Git - thirdparty/foundation/foundation-sites.git/commitdiff
Remove duplicate swipe event 11716/head
authorDaniel Ruf <daniel.ruf@ueberbit.de>
Thu, 7 Mar 2019 10:41:05 +0000 (11:41 +0100)
committerDaniel Ruf <daniel.ruf@ueberbit.de>
Thu, 7 Mar 2019 10:41:05 +0000 (11:41 +0100)
js/foundation.orbit.js
test/javascript/components/orbit.js

index 233a685d59ede83914749fbf082f173865b15f18..730f68c26902b159bfaede30aaedd2ff32ded2e4 100644 (file)
@@ -200,14 +200,6 @@ class Orbit extends Plugin {
         }).on('swiperight.zf.orbit', function(e){
           e.preventDefault();
           _this.changeSlide(false);
-        }).on('swipe.zf.orbit', function(e, dir){
-          if(dir === 'left') {
-            e.preventDefault();
-            _this.changeSlide(true);
-          } else if (dir === 'right') {
-            e.preventDefault();
-            _this.changeSlide(false);
-          }
         });
       }
       //***************************************
index 050942a5839da3d99d366c3930f86c7082fd5e32..151c634f4c78671519cdd1aadeb094bc8ea0a2d8 100644 (file)
@@ -200,24 +200,16 @@ describe('Orbit', function() {
       $html.find('.orbit-slide').eq(0).should.be.hidden;
       $html.find('.orbit-slide').eq(2).should.be.visible;
     });
-    it('changes slides on swipe with data left', function() {
+    /*it('changes slides on swipeleft (touchmove)', function() {
       $html = $(template).appendTo('body');
       plugin = new Foundation.Orbit($html, {});
 
-      $html.find('.orbit-slide').eq(0).trigger('swipe', 'left');
-
-      $html.find('.orbit-slide').eq(0).should.be.hidden;
-      $html.find('.orbit-slide').eq(1).should.be.visible;
-    });
-    it('changes slides on swipe with data right', function() {
-      $html = $(template).appendTo('body');
-      plugin = new Foundation.Orbit($html, {});
-
-      $html.find('.orbit-slide').eq(0).trigger('swipe', 'right');
-
-      $html.find('.orbit-slide').eq(0).should.be.hidden;
-      $html.find('.orbit-slide').eq(3).should.be.visible;
-    });
+      $html.find('.orbit-slide').eq(0).trigger($.Event("touchstart", {"touches": [{"pageX": 200, "pageY": 10}]}));
+      $html.find('.orbit-slide').eq(0).trigger($.Event("touchmove", {"touches": [{"pageX": 100, "pageY": 10}]}));
+      $html.find('.orbit-slide').eq(0).trigger($.Event("touchend", {"touches": [{"pageX": 0, "pageY": 10}]}));
+      $html.find('.orbit-slide').eq(0).should.be.visible;
+      $html.find('.orbit-slide').eq(1).should.be.hidden;
+    });*/
     it('changes slides on swipeleft', function() {
       $html = $(template).appendTo('body');
       plugin = new Foundation.Orbit($html, {});
@@ -234,7 +226,7 @@ describe('Orbit', function() {
       $html.find('.orbit-slide').eq(0).trigger('swiperight');
 
       $html.find('.orbit-slide').eq(0).should.be.hidden;
-      $html.find('.orbit-slide').eq(3).should.be.visible;
+      $html.find('.orbit-slide').eq(-1).should.be.visible;
     });
     it('changes slides to the previous one', function() {
       $html = $(template).appendTo('body');