ピン留めを解除することができるようにしたり
This commit is contained in:
@ -28,11 +28,19 @@ export default Vue.extend({
|
||||
}];
|
||||
|
||||
if (this.note.userId == this.$store.state.i.id) {
|
||||
items.push({
|
||||
icon: '%fa:thumbtack%',
|
||||
text: '%i18n:@pin%',
|
||||
action: this.pin
|
||||
});
|
||||
if (this.$store.state.i.pinnedNoteIds.includes(this.note.id)) {
|
||||
items.push({
|
||||
icon: '%fa:thumbtack%',
|
||||
text: '%i18n:@unpin%',
|
||||
action: this.unpin
|
||||
});
|
||||
} else {
|
||||
items.push({
|
||||
icon: '%fa:thumbtack%',
|
||||
text: '%i18n:@pin%',
|
||||
action: this.pin
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (this.note.userId == this.$store.state.i.id || this.$store.state.i.isAdmin) {
|
||||
@ -56,6 +64,7 @@ export default Vue.extend({
|
||||
return items;
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
detail() {
|
||||
this.$router.push(`/notes/${ this.note.id }`);
|
||||
@ -73,6 +82,14 @@ export default Vue.extend({
|
||||
});
|
||||
},
|
||||
|
||||
unpin() {
|
||||
(this as any).api('i/unpin', {
|
||||
noteId: this.note.id
|
||||
}).then(() => {
|
||||
this.destroyDom();
|
||||
});
|
||||
},
|
||||
|
||||
del() {
|
||||
if (!window.confirm('%i18n:@delete-confirm%')) return;
|
||||
(this as any).api('notes/delete', {
|
||||
|
Reference in New Issue
Block a user