* Fix #5798 * clean * Update src/client/components/post-form-attaches.vue Co-Authored-By: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com> * nest Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
parent
3ae73555a9
commit
aade954dd7
|
@ -1,6 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="skeikyzd" v-show="files.length != 0">
|
<div class="skeikyzd" v-show="files.length != 0">
|
||||||
<x-draggable class="files" :list="files" animation="150">
|
<x-draggable class="files" :list="files" animation="150" delay="100" delayOnTouchOnly="true">
|
||||||
<div v-for="file in files" :key="file.id" @click="showFileMenu(file, $event)" @contextmenu.prevent="showFileMenu(file, $event)">
|
<div v-for="file in files" :key="file.id" @click="showFileMenu(file, $event)" @contextmenu.prevent="showFileMenu(file, $event)">
|
||||||
<x-file-thumbnail :data-id="file.id" class="thumbnail" :file="file" fit="cover"/>
|
<x-file-thumbnail :data-id="file.id" class="thumbnail" :file="file" fit="cover"/>
|
||||||
<div class="sensitive" v-if="file.isSensitive">
|
<div class="sensitive" v-if="file.isSensitive">
|
||||||
|
@ -41,6 +41,8 @@ export default Vue.extend({
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
|
menu: null as Promise<null> | null,
|
||||||
|
|
||||||
faExclamationTriangle
|
faExclamationTriangle
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -80,7 +82,8 @@ export default Vue.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
showFileMenu(file, ev: MouseEvent) {
|
showFileMenu(file, ev: MouseEvent) {
|
||||||
this.$root.menu({
|
if (this.menu) return;
|
||||||
|
this.menu = this.$root.menu({
|
||||||
items: [{
|
items: [{
|
||||||
text: this.$t('renameFile'),
|
text: this.$t('renameFile'),
|
||||||
icon: faICursor,
|
icon: faICursor,
|
||||||
|
@ -95,7 +98,7 @@ export default Vue.extend({
|
||||||
action: () => { this.detachMedia(file.id) }
|
action: () => { this.detachMedia(file.id) }
|
||||||
}],
|
}],
|
||||||
source: ev.currentTarget || ev.target
|
source: ev.currentTarget || ev.target
|
||||||
});
|
}).then(() => this.menu = null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue