mirror of
https://github.com/nkanaev/yarr.git
synced 2025-05-24 00:33:14 +00:00
item status change tweaks
This commit is contained in:
parent
aa015b78c0
commit
89ce8df0e3
@ -203,7 +203,6 @@
|
|||||||
<span class="icon" v-else-if="itemSelectedDetails.status!='starred'" >{% inline "star.svg" %}</span>
|
<span class="icon" v-else-if="itemSelectedDetails.status!='starred'" >{% inline "star.svg" %}</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="toolbar-item"
|
<button class="toolbar-item"
|
||||||
:disabled="itemSelectedDetails.status=='starred'"
|
|
||||||
v-b-tooltip.hover.bottom="'Mark Unread'"
|
v-b-tooltip.hover.bottom="'Mark Unread'"
|
||||||
@click="toggleItemRead(itemSelectedDetails)">
|
@click="toggleItemRead(itemSelectedDetails)">
|
||||||
<span class="icon" v-if="itemSelectedDetails.status=='unread'">{% inline "circle-full.svg" %}</span>
|
<span class="icon" v-if="itemSelectedDetails.status=='unread'">{% inline "circle-full.svg" %}</span>
|
||||||
|
@ -536,6 +536,9 @@ var vm = new Vue({
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
toggleItemStarred: function(item) {
|
toggleItemStarred: function(item) {
|
||||||
|
if (item.status == 'unread') {
|
||||||
|
this.feedStats[item.feed_id].unread -= 1
|
||||||
|
}
|
||||||
if (item.status == 'starred') {
|
if (item.status == 'starred') {
|
||||||
item.status = 'read'
|
item.status = 'read'
|
||||||
this.feedStats[item.feed_id].starred -= 1
|
this.feedStats[item.feed_id].starred -= 1
|
||||||
@ -546,10 +549,13 @@ var vm = new Vue({
|
|||||||
api.items.update(item.id, {status: item.status})
|
api.items.update(item.id, {status: item.status})
|
||||||
},
|
},
|
||||||
toggleItemRead: function(item) {
|
toggleItemRead: function(item) {
|
||||||
|
if (item.status == 'starred') {
|
||||||
|
this.feedStats[item.feed_id].starred -= 1
|
||||||
|
}
|
||||||
if (item.status == 'unread') {
|
if (item.status == 'unread') {
|
||||||
item.status = 'read'
|
item.status = 'read'
|
||||||
this.feedStats[item.feed_id].unread -= 1
|
this.feedStats[item.feed_id].unread -= 1
|
||||||
} else if (item.status == 'read') {
|
} else if (item.status != 'unread') {
|
||||||
item.status = 'unread'
|
item.status = 'unread'
|
||||||
this.feedStats[item.feed_id].unread += 1
|
this.feedStats[item.feed_id].unread += 1
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user