From 6e059970eb97cf99907f3db9089514241bef4c9e Mon Sep 17 00:00:00 2001 From: thednp Date: Tue, 9 Apr 2019 16:59:25 +0300 Subject: [PATCH] --- dist/bootstrap-native-v4.js | 84 ++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/dist/bootstrap-native-v4.js b/dist/bootstrap-native-v4.js index f57515d5..3aec6964 100644 --- a/dist/bootstrap-native-v4.js +++ b/dist/bootstrap-native-v4.js @@ -575,52 +575,52 @@ } self.slideTo( index ); //Do the slide }, - // touch events - toggleTouchEvents = function(toggle){ - toggle( element, touchEvents.move, touchMoveHandler ); - toggle( element, touchEvents.end, touchEndHandler ); - }, - touchDownHandler = function(e) { - if ( isTouch ) { return; } - - startXPosition = parseInt(e.touches[0].pageX); - - if ( element.contains(e[target]) ) { - isTouch = true; - toggleTouchEvents(on); - } - }, - touchMoveHandler = function(e) { - if ( !isTouch ) { e.preventDefault(); return; } - - currentXPosition = parseInt(e.touches[0].pageX); + // touch events + toggleTouchEvents = function(toggle){ + toggle( element, touchEvents.move, touchMoveHandler ); + toggle( element, touchEvents.end, touchEndHandler ); + }, + touchDownHandler = function(e) { + if ( isTouch ) { return; } - //cancel touch if more than one touches detected - if ( e.type === 'touchmove' && e.touches[length] > 1 ) { - e.preventDefault(); + startXPosition = parseInt(e.touches[0].pageX); + + if ( element.contains(e[target]) ) { + isTouch = true; + toggleTouchEvents(on); + } + }, + touchMoveHandler = function(e) { + if ( !isTouch ) { e.preventDefault(); return; } + + currentXPosition = parseInt(e.touches[0].pageX); + + //cancel touch if more than one touches detected + if ( e.type === 'touchmove' && e.touches[length] > 1 ) { + e.preventDefault(); + return false; + } + }, + touchEndHandler = function(e) { + if ( !isTouch || isSliding ) { return } + + endXPosition = currentXPosition || parseInt( e.touches[0].pageX ); + + if ( isTouch ) { + if ( (!element.contains(e[target]) || !element.contains(e.relatedTarget) ) && Math.abs(startXPosition - endXPosition) < 75 ) { return false; - } - }, - touchEndHandler = function(e) { - if ( !isTouch || isSliding ) { return } - - endXPosition = currentXPosition || parseInt( e.touches[0].pageX ); - - if ( isTouch ) { - if ( (!element.contains(e[target]) || !element.contains(e.relatedTarget) ) && Math.abs(startXPosition - endXPosition) < 75 ) { - return false; - } else { - if ( currentXPosition < startXPosition ) { - index++; - } else if ( currentXPosition > startXPosition ) { - index--; - } - isTouch = false; - self.slideTo(index); + } else { + if ( currentXPosition < startXPosition ) { + index++; + } else if ( currentXPosition > startXPosition ) { + index--; } - toggleTouchEvents(off); + isTouch = false; + self.slideTo(index); } - }, + toggleTouchEvents(off); + } + }, // private methods isElementInScrollRange = function () {