mirror of
https://github.com/nkanaev/yarr.git
synced 2025-07-08 16:00:11 +00:00
scroll item list to top when feed is changed
This commit is contained in:
parent
b51408880b
commit
7e6ae1311e
@ -149,7 +149,7 @@
|
||||
<span class="icon">{% inline "check.svg" %}</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="p-2 overflow-auto border-top" v-scroll="loadMoreItems">
|
||||
<div class="p-2 overflow-auto border-top" v-scroll="loadMoreItems" ref="itemlist">
|
||||
<label v-for="item in items" :key="item.id"
|
||||
class="selectgroup">
|
||||
<input type="radio" name="item" :value="item.id" v-model="itemSelected">
|
||||
|
@ -240,6 +240,7 @@ var vm = new Vue({
|
||||
if (oldVal === null) return // do nothing, initial setup
|
||||
api.settings.update({feed: newVal}).then(this.refreshItems.bind(this))
|
||||
this.itemSelected = null
|
||||
if (this.$refs.itemlist) this.$refs.itemlist.scrollTop = 0
|
||||
},
|
||||
'itemSelected': function(newVal, oldVal) {
|
||||
this.itemSelectedReadability = ''
|
||||
@ -247,9 +248,8 @@ var vm = new Vue({
|
||||
this.itemSelectedDetails = null
|
||||
return
|
||||
}
|
||||
if (this.$refs.content) {
|
||||
this.$refs.content.scrollTop = 0
|
||||
}
|
||||
if (this.$refs.content) this.$refs.content.scrollTop = 0
|
||||
|
||||
this.itemSelectedDetails = this.itemsById[newVal]
|
||||
if (this.itemSelectedDetails.status == 'unread') {
|
||||
this.itemSelectedDetails.status = 'read'
|
||||
|
Loading…
x
Reference in New Issue
Block a user