diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-12-05 12:50:09 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-12-05 12:50:09 +0900 |
| commit | af5b4749b0f46d53b7bf6cae62776fa4601bf9b3 (patch) | |
| tree | b2cab8babf29fbcb1c0678c3ca061a7d2b4b5c6d /src/client/components/post-form.vue | |
| parent | Update deps (diff) | |
| download | misskey-af5b4749b0f46d53b7bf6cae62776fa4601bf9b3.tar.gz misskey-af5b4749b0f46d53b7bf6cae62776fa4601bf9b3.tar.bz2 misskey-af5b4749b0f46d53b7bf6cae62776fa4601bf9b3.zip | |
Use vuedraggable instead of vue-draggable-next
Fix #6852
Diffstat (limited to 'src/client/components/post-form.vue')
| -rw-r--r-- | src/client/components/post-form.vue | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/client/components/post-form.vue b/src/client/components/post-form.vue index 020b925fb9..3f4561dad8 100644 --- a/src/client/components/post-form.vue +++ b/src/client/components/post-form.vue @@ -36,7 +36,7 @@ </div> <input v-show="useCw" ref="cw" class="cw" v-model="cw" :placeholder="$t('annotation')" @keydown="onKeydown"> <textarea v-model="text" class="text" :class="{ withCw: useCw }" ref="text" :disabled="posting" :placeholder="placeholder" @keydown="onKeydown" @paste="onPaste"></textarea> - <XPostFormAttaches class="attaches" :files="files" @updated="updateMedia" @detach="detachMedia"/> + <XPostFormAttaches class="attaches" :files="files" @updated="updateFiles" @detach="detachFile" @changeSensitive="updateFileSensitive" @changeName="updateFileName"/> <XPollEditor v-if="poll" :poll="poll" @destroyed="poll = null" @updated="onPollUpdate"/> <footer> <button class="_button" @click="chooseFileFrom" v-tooltip="$t('attachFile')"><Fa :icon="faPhotoVideo"/></button> @@ -359,12 +359,20 @@ export default defineComponent({ }); }, - detachMedia(id) { + detachFile(id) { this.files = this.files.filter(x => x.id != id); }, - updateMedia(file) { - this.files[this.files.findIndex(x => x.id === file.id)] = file; + updateFiles(files) { + this.files = files; + }, + + updateFileSensitive(file, sensitive) { + this.files[this.files.findIndex(x => x.id === file.id)].isSensitive = sensitive; + }, + + updateFileName(file, name) { + this.files[this.files.findIndex(x => x.id === file.id)].name = name; }, upload(file: File, name?: string) { |