forked from FoundKeyGang/FoundKey
parent
9e318d5ebc
commit
2a235151ed
2 changed files with 23 additions and 3 deletions
|
@ -285,6 +285,8 @@ common/views/components/nav.vue:
|
|||
feedback: "フィードバック"
|
||||
|
||||
common/views/components/note-menu.vue:
|
||||
detail: "詳細"
|
||||
copy-link: "リンクをコピー"
|
||||
favorite: "お気に入り"
|
||||
pin: "ピン留め"
|
||||
delete: "削除"
|
||||
|
|
|
@ -6,17 +6,27 @@
|
|||
|
||||
<script lang="ts">
|
||||
import Vue from 'vue';
|
||||
import { url } from '../../../config';
|
||||
import copyToClipboard from '../../../common/scripts/copy-to-clipboard';
|
||||
|
||||
export default Vue.extend({
|
||||
props: ['note', 'source', 'compact'],
|
||||
computed: {
|
||||
items() {
|
||||
const items = [];
|
||||
items.push({
|
||||
const items = [{
|
||||
icon: '%fa:info-circle%',
|
||||
text: '%i18n:@detail%',
|
||||
action: this.detail
|
||||
}, {
|
||||
icon: '%fa:link%',
|
||||
text: '%i18n:@copy-link%',
|
||||
action: this.copyLink
|
||||
}, null, {
|
||||
icon: '%fa:star%',
|
||||
text: '%i18n:@favorite%',
|
||||
action: this.favorite
|
||||
});
|
||||
}];
|
||||
|
||||
if (this.note.userId == this.$store.state.i.id) {
|
||||
items.push({
|
||||
icon: '%fa:thumbtack%',
|
||||
|
@ -42,6 +52,14 @@ export default Vue.extend({
|
|||
}
|
||||
},
|
||||
methods: {
|
||||
detail() {
|
||||
this.$router.push(`/notes/${ this.note.id }`);
|
||||
},
|
||||
|
||||
copyLink() {
|
||||
copyToClipboard(`${url}/notes/${ this.note.id }`);
|
||||
},
|
||||
|
||||
pin() {
|
||||
(this as any).api('i/pin', {
|
||||
noteId: this.note.id
|
||||
|
|
Loading…
Reference in a new issue