Skip to content

Commit

Permalink
Swiper: fix can not scroll, when swiper is too high
Browse files Browse the repository at this point in the history
Close #292
  • Loading branch information
loerise authored and airyland committed Jun 23, 2016
1 parent a28e23f commit f7bbd14
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/components/swiper/swiper.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,17 @@ class Swiper {
let distance = me._move.y - me._start.y
let transform = 'translate3d(0, ' + (distance - me._offset) + 'px, 0)'

if (me._options.direction === 'horizontal') {
if (me._options.direction === 'horizontal' && Math.abs(me._move.x) > Math.abs(me._move.y)) {
distance = me._move.x - me._start.x
transform = 'translate3d(' + (distance - me._offset) + 'px, 0, 0)'
}

if ((me._options.minMovingDistance && distance >= me._options.minMovingDistance) || !me._options.minMovingDistance) {
if (((me._options.minMovingDistance && distance >= me._options.minMovingDistance) || !me._options.minMovingDistance) && Math.abs(me._move.x) > Math.abs(me._move.y)) {
me.$container.style['-webkit-transform'] = transform
me.$container.style.transform = transform
}

e.preventDefault()
Math.abs(me._move.x) > Math.abs(me._move.y) && e.preventDefault()
}

this.touchendHandler = (e) => {
Expand Down

0 comments on commit f7bbd14

Please sign in to comment.