Skip to content

Commit

Permalink
fix(QPageScroller): fix calculation for reverse mode quasarframework#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Mar 17, 2021
1 parent a6b7e45 commit 0aa0d7d
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions ui/src/components/page-scroller/QPageScroller.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export default Vue.extend({
computed: {
height () {
return this.layout.container === true
? this.layout.containerHeight
? this.layout.height - this.layout.containerHeight
: this.layout.height
},

Expand Down Expand Up @@ -78,14 +78,22 @@ export default Vue.extend({
methods: {
__isVisible () {
return this.reverse === true
? this.height - this.layout.scroll.position > this.scrollOffset
? this.__getScrollHeight() - this.layout.scroll.position > this.scrollOffset
: this.layout.scroll.position > this.scrollOffset
},

__getScrollHeight () {
return 0
},

__getScrollHeightClient () {
return this.layout.container === true
? this.height
: this.height - window.innerHeight
},

__onClick (e) {
const target = this.layout.container === true
? getScrollTarget(this.$el)
: getScrollTarget(this.layout.$el)
const target = getScrollTarget(this.layout.container === true ? this.$el : this.layout.$el)

setScrollPosition(target, this.reverse === true ? this.layout.height : 0, this.duration)
this.$emit('click', e)
Expand Down Expand Up @@ -121,6 +129,10 @@ export default Vue.extend({
)
},

mounted () {
this.__getScrollHeight = this.__getScrollHeightClient
},

beforeDestroy () {
this.heightWatcher !== void 0 && this.__cleanup()
}
Expand Down

0 comments on commit 0aa0d7d

Please sign in to comment.