@@ -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) {
|
||||
|
Reference in New Issue
Block a user