mirror of
https://github.com/nkanaev/yarr.git
synced 2025-09-13 18:00:05 +00:00
item status toggle buttons
This commit is contained in:
1
template/static/images/star-full.svg
Normal file
1
template/static/images/star-full.svg
Normal 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 |
@@ -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'
|
||||
}
|
||||
},
|
||||
}
|
||||
})
|
||||
|
Reference in New Issue
Block a user