Skip to content
Snippets Groups Projects
Unverified Commit a8d66996 authored by Christoph Wurst's avatar Christoph Wurst Committed by GitHub
Browse files

Merge pull request #1249 from nextcloud/fix/vue-disable-local-attach-btn-uploading

Disable local attachments button while uploading
parents c7f9c791 13379812
No related branches found
No related tags found
No related merge requests found
......@@ -31,9 +31,13 @@
</li>
</ul>
<button class="button"
:disabled="uploading"
v-on:click="onAddLocalAttachment">
<span class="icon-upload"/>
{{ t('mail', 'Upload attachment') }}
<span :class="{ 'icon-upload' : !uploading, 'icon-loading-small': uploading }"/>
{{ uploading ?
t('mail', 'Uploading …') :
t('mail', 'Upload attachment')
}}
</button>
<button class="button"
v-on:click="onAddCloudAttachment">
......@@ -57,6 +61,11 @@
export default {
name: 'ComposerAttachments',
data () {
return {
uploading: false,
}
},
props: {
value: {
type: Array,
......@@ -79,6 +88,8 @@
this.$emit('input', this.value.concat([attachment]))
},
onLocalAttachmentSelected (e) {
this.uploading = true
return Promise.all(
_.map(
e.target.files,
......@@ -90,7 +101,9 @@
)
})
)
).catch(console.error.bind(this))
)
.catch(console.error.bind(this))
.then(() => this.uploading = false)
},
onAddCloudAttachment () {
return pickFileOrDirectory(t('mail', 'Choose a file to add as attachment'))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment