aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/components/post_status_form/post_status_form.js4
-rw-r--r--src/components/post_status_form/post_status_form.vue5
2 files changed, 9 insertions, 0 deletions
diff --git a/src/components/post_status_form/post_status_form.js b/src/components/post_status_form/post_status_form.js
index 60698e6e..9995813e 100644
--- a/src/components/post_status_form/post_status_form.js
+++ b/src/components/post_status_form/post_status_form.js
@@ -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
},
diff --git a/src/components/post_status_form/post_status_form.vue b/src/components/post_status_form/post_status_form.vue
index 71787cc5..b18e5d80 100644
--- a/src/components/post_status_form/post_status_form.vue
+++ b/src/components/post_status_form/post_status_form.vue
@@ -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>