1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-11-28 23:08:17 +09:00
* 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:
tamaina 2020-02-04 09:20:10 +09:00 committed by GitHub
parent 3ae73555a9
commit aade954dd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
<template>
<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)">
<x-file-thumbnail :data-id="file.id" class="thumbnail" :file="file" fit="cover"/>
<div class="sensitive" v-if="file.isSensitive">
@ -41,6 +41,8 @@ export default Vue.extend({
data() {
return {
menu: null as Promise<null> | null,
faExclamationTriangle
};
},
@ -80,7 +82,8 @@ export default Vue.extend({
});
},
showFileMenu(file, ev: MouseEvent) {
this.$root.menu({
if (this.menu) return;
this.menu = this.$root.menu({
items: [{
text: this.$t('renameFile'),
icon: faICursor,
@ -95,7 +98,7 @@ export default Vue.extend({
action: () => { this.detachMedia(file.id) }
}],
source: ev.currentTarget || ev.target
});
}).then(() => this.menu = null);
}
}
});