mirror of
https://github.com/nkanaev/yarr.git
synced 2025-07-09 00:10:09 +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>
|
<span class="icon">{% inline "check.svg" %}</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</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"
|
<label v-for="item in items" :key="item.id"
|
||||||
class="selectgroup">
|
class="selectgroup">
|
||||||
<input type="radio" name="item" :value="item.id" v-model="itemSelected">
|
<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
|
if (oldVal === null) return // do nothing, initial setup
|
||||||
api.settings.update({feed: newVal}).then(this.refreshItems.bind(this))
|
api.settings.update({feed: newVal}).then(this.refreshItems.bind(this))
|
||||||
this.itemSelected = null
|
this.itemSelected = null
|
||||||
|
if (this.$refs.itemlist) this.$refs.itemlist.scrollTop = 0
|
||||||
},
|
},
|
||||||
'itemSelected': function(newVal, oldVal) {
|
'itemSelected': function(newVal, oldVal) {
|
||||||
this.itemSelectedReadability = ''
|
this.itemSelectedReadability = ''
|
||||||
@ -247,9 +248,8 @@ var vm = new Vue({
|
|||||||
this.itemSelectedDetails = null
|
this.itemSelectedDetails = null
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (this.$refs.content) {
|
if (this.$refs.content) this.$refs.content.scrollTop = 0
|
||||||
this.$refs.content.scrollTop = 0
|
|
||||||
}
|
|
||||||
this.itemSelectedDetails = this.itemsById[newVal]
|
this.itemSelectedDetails = this.itemsById[newVal]
|
||||||
if (this.itemSelectedDetails.status == 'unread') {
|
if (this.itemSelectedDetails.status == 'unread') {
|
||||||
this.itemSelectedDetails.status = 'read'
|
this.itemSelectedDetails.status = 'read'
|
||||||
|
Loading…
x
Reference in New Issue
Block a user