Skip to content

Commit

Permalink
fix(image-preview): over height image should be scrolling always
Browse files Browse the repository at this point in the history
  • Loading branch information
dolymood committed Oct 8, 2018
1 parent ff803a8 commit d2a72d5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/components/image-preview/image-preview.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@
speed: {
type: Number,
default: 400
},
preventDefault: {
type: Boolean,
default: true
}
},
data() {
Expand All @@ -88,7 +92,8 @@
right: true
},
useTransition: !isAndroid,
probeType: 3
probeType: 3,
preventDefault: this.preventDefault
},
scrollOptions: {
observeDOM: false,
Expand All @@ -101,7 +106,8 @@
bounce: false,
click: false,
dblclick: true,
bounceTime: 300
bounceTime: 300,
preventDefault: this.preventDefault
}
}
},
Expand Down Expand Up @@ -222,7 +228,7 @@
})
},
checkBoundary(scroll, pos) {
if (scroll.distX) {
if (scroll.distX && Math.abs(scroll.distX) > Math.abs(scroll.distY)) {
this._scrolling = true
const reached = scroll.distX > 0 ? pos.x >= scroll.minScrollX : pos.x <= scroll.maxScrollX
if (reached) {
Expand Down

0 comments on commit d2a72d5

Please sign in to comment.