Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Composer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -1035,8 +1035,8 @@ export default {
this.attachmentsPromise = this.attachmentsPromise
.then(() => uploaded)
.then(() => this.callSaveDraft(true, this.getMessageData))
.catch((error) => logger.error('could not upload attachments', { error }))
.then(() => logger.debug('attachments uploaded'))
.catch((error) => logger.error('could not upload attachments', { error }))
},
async onMailvelopeLoaded(mailvelope) {
this.encrypt = isPgpgMessage(this.body)
Expand Down
38 changes: 26 additions & 12 deletions src/components/ComposerAttachments.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,21 @@

<template>
<div class="new-message-attachments">
<div v-if="hasNextLine" class="message-attachments-count" @click="isToggle = !isToggle">
<div v-if="hasNextLine"
class="new-message-attachments--counter"
:class="{ 'new-message-attachments--counter--with-errors': hasAttachmentErrors }"
@click="isToggle = !isToggle">
<span>
{{ n('mail', '{count} attachment', '{count} attachments', attachments.length, { count: attachments.length }) }} ({{ formatBytes(totalSizeOfUpload()) }})
</span>
<ChevronUp v-if="isToggle" :size="24" />
<ChevronDown v-if="!isToggle" :size="24" />
</div>
<ul class="new-message-attachments--list" :class="isToggle ? 'hide' : (hasNextLine ? 'active' : '')">
<ul class="new-message-attachments--list"
:class="{
hide: isToggle,
active: !isToggle && hasNextLine,
}">
<ComposerAttachment
v-for="attachment in attachments"
ref="attachments"
Expand Down Expand Up @@ -110,6 +117,9 @@ export default {
}
},
computed: {
hasAttachmentErrors() {
return this.attachments.some(attachment => attachment.error)
},
uploadProgress() {
let uploaded = 0
let total = 0
Expand Down Expand Up @@ -268,7 +278,7 @@ export default {
}])
})
} catch (error) {

logger.error('Could not upload file', { file, error })
}
}, e.target.files)

Expand Down Expand Up @@ -422,7 +432,19 @@ export default {
<style scoped lang="scss">

.new-message-attachments {
ul.new-message-attachments--list {
&--counter {
color: var(--color-text-maxcontrast);
padding: 10px 20px;
cursor:pointer;
display:flex;
align-items: center;

&--with-errors {
color:red;
}
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please place cursor:pointer; to all child elements
&--counter * { cursor:pointer; }

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

&--list {
display: flex;
flex-wrap: wrap;
// 2 and a half attachment height
Expand All @@ -441,13 +463,5 @@ export default {
max-height: 287px;
}
}

.message-attachments-count {
color: var(--color-text-maxcontrast);
padding: 10px 20px;
cursor:pointer;
display:flex;
align-items: center;
}
}
</style>