diff --git a/build/iscroll-infinite.js b/build/iscroll-infinite.js index 10170f69..6720fd67 100644 --- a/build/iscroll-infinite.js +++ b/build/iscroll-infinite.js @@ -1,4 +1,4 @@ -/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.1.3 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -276,7 +276,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -392,6 +395,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -492,7 +499,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -543,6 +558,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, diff --git a/build/iscroll-lite.js b/build/iscroll-lite.js index bd143b79..b1b924b0 100644 --- a/build/iscroll-lite.js +++ b/build/iscroll-lite.js @@ -1,4 +1,4 @@ -/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.1.3 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -269,7 +269,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -359,6 +362,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -459,7 +466,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -504,6 +519,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, diff --git a/build/iscroll-probe.js b/build/iscroll-probe.js index 538d0e38..1b2d4353 100644 --- a/build/iscroll-probe.js +++ b/build/iscroll-probe.js @@ -1,4 +1,4 @@ -/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.1.3 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -275,7 +275,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -390,6 +393,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -490,7 +497,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -541,6 +556,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, diff --git a/build/iscroll-zoom.js b/build/iscroll-zoom.js index 4faccdfc..ea739e46 100644 --- a/build/iscroll-zoom.js +++ b/build/iscroll-zoom.js @@ -1,4 +1,4 @@ -/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.1.3 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -278,7 +278,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -396,6 +399,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -496,7 +503,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -541,6 +556,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, diff --git a/build/iscroll.js b/build/iscroll.js index 8bd2b8da..909e1f86 100644 --- a/build/iscroll.js +++ b/build/iscroll.js @@ -1,4 +1,4 @@ -/*! iScroll v5.1.3 ~ (c) 2008-2014 Matteo Spinelli ~ http://cubiq.org/license */ +/*! iScroll v5.1.3 ~ (c) 2008-2016 Matteo Spinelli ~ http://cubiq.org/license */ (function (window, document, Math) { var rAF = window.requestAnimationFrame || window.webkitRequestAnimationFrame || @@ -275,7 +275,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -387,6 +390,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -487,7 +494,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -532,6 +547,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY, diff --git a/src/core.js b/src/core.js index dcfab624..6fe5b541 100644 --- a/src/core.js +++ b/src/core.js @@ -23,7 +23,10 @@ function IScroll (el, options) { HWCompositing: true, useTransition: true, - useTransform: true + useTransform: true, + + VUPBoundary:true, //true : respect v-boundary when not overflow, false: can scroll when not overflow + VDOWNboundary:true, }; for ( var i in options ) { @@ -113,6 +116,10 @@ IScroll.prototype = { return; } + if (this.isAnimating || this.isInTransition) { + e.preventDefault(); + } + if ( this.options.preventDefault && !utils.isBadAndroid && !utils.preventDefaultException(e.target, this.options.preventDefaultException) ) { e.preventDefault(); } @@ -213,7 +220,15 @@ IScroll.prototype = { } deltaX = this.hasHorizontalScroll ? deltaX : 0; - deltaY = this.hasVerticalScroll ? deltaY : 0; + + // Still scroll when wrapper is not over-flow by scroller + if(!this.options.VUPBoundary && deltaY < 0) { + deltaY = deltaY; + }else if(!this.options.VDOWNboundary && deltaY > 0) { + deltaY = deltaY; + }else { + deltaY = this.hasVerticalScroll ? deltaY : 0; + } newX = this.x + deltaX; newY = this.y + deltaY; @@ -258,6 +273,8 @@ IScroll.prototype = { e.preventDefault(); } + this._execEvent('touchEnd'); + var point = e.changedTouches ? e.changedTouches[0] : e, momentumX, momentumY,