Skip to content

Commit

Permalink
Scroller: Add scroller:reset event close #120
Browse files Browse the repository at this point in the history
  • Loading branch information
airyland committed Apr 21, 2016
1 parent dc95809 commit 1dae865
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/components/scroller/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default {
}
},
methods: {
render () {
reset () {
this._xscroll && this._xscroll.render()
}
},
Expand All @@ -111,9 +111,9 @@ export default {
},
computed: {
styles () {
if (!this.height && !this.$el.style.height) {
if (!this.height && !this.$el.style.height && this.lockX) {
this.height = `${document.documentElement.clientHeight}px`
this.render()
this.reset()
}
return {
height: `${this.height}`
Expand Down Expand Up @@ -192,7 +192,7 @@ export default {
if (uuid === this.uuid) {
this.pulldown.reset(() => {
// repaint
this.render()
this.reset()
})
}
},
Expand All @@ -201,11 +201,16 @@ export default {
this.pullupStatus = 'default'
if (uuid === this.uuid) {
this.pullup.complete()
this.render()
this.reset()
}
},
'pullup:done': function (uuid) {
this._xscroll.unplug(this.pullup)
},
'scroller:reset': function (uuid) {
if (uuid === this.uuid) {
this.reset()
}
}
},
beforeDestroy () {
Expand Down

0 comments on commit 1dae865

Please sign in to comment.