item status toggle buttons

This commit is contained in:
Nazar Kanaev
2020-07-05 13:44:20 +01:00
parent 5fc436a36b
commit 7ecdada4ca
3 changed files with 30 additions and 1 deletions

View File

@@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-star"><polygon points="12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2"></polygon></svg>

After

Width:  |  Height:  |  Size: 348 B

View File

@@ -55,6 +55,9 @@ var vm = new Vue({
},
'itemSelected': function(newVal, oldVal) {
this.itemSelectedDetails = this.itemsById[newVal]
if (this.itemSelectedDetails.status == 'unread') {
this.itemSelectedDetails.status = 'read'
}
},
},
methods: {
@@ -141,5 +144,19 @@ var vm = new Vue({
vm.loading.newfeed = false
})
},
toggleItemStarred: function(item) {
if (item.status == 'starred') {
item.status = 'read'
} else if (item.status != 'starred') {
item.status = 'starred'
}
},
toggleItemRead: function(item) {
if (item.status == 'unread') {
item.status = 'read'
} else if (item.status == 'read') {
item.status = 'unread'
}
},
}
})