Add remove attachment button
This commit is contained in:
parent
6f0c73c30a
commit
01edb7dbe4
14 changed files with 88 additions and 65 deletions
|
@ -63,6 +63,10 @@ const PostStatusForm = {
|
|||
this.newStatus.files.push(fileInfo)
|
||||
this.enableSubmit()
|
||||
},
|
||||
removeMediaFile (fileInfo) {
|
||||
let index = this.newStatus.files.indexOf(fileInfo)
|
||||
this.newStatus.files.splice(index, 1)
|
||||
},
|
||||
disableSubmit () {
|
||||
this.submitDisabled = true
|
||||
},
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<video v-if="type(file) === 'video'" :src="file.image" controls></video>
|
||||
<audio v-if="type(file) === 'audio'" :src="file.image" controls></audio>
|
||||
<a v-if="type(file) === 'unknown'" :href="file.image">{{file.url}}</a>
|
||||
<i class="fa icon-cancel" @click="removeMediaFile(file)"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div class='form-bottom'>
|
||||
|
@ -56,6 +57,10 @@
|
|||
.btn[disabled] {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
|
||||
.icon-cancel {
|
||||
cursor: pointer;
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue