diff --git a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js index 29653cf5425..730a6a0cae9 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -269,17 +269,6 @@ export class AttachmentViewer extends Component { // Handlers //-------------------------------------------------------------------------- - /** - * Called when clicking on download icon. - * - * @private - * @param {MouseEvent} ev - */ - _onClickDownload(ev) { - ev.stopPropagation(); - this.attachmentViewer.attachment.download(); - } - /** * @private * @param {MouseEvent} ev diff --git a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml index 8d74ef96e6c..2847ecdae30 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml @@ -25,7 +25,7 @@
-
+
Download @@ -78,7 +78,7 @@
-
+
diff --git a/addons/mail/static/src/models/attachment_viewer.js b/addons/mail/static/src/models/attachment_viewer.js index 13bbb5f5340..aa9ab1e8357 100644 --- a/addons/mail/static/src/models/attachment_viewer.js +++ b/addons/mail/static/src/models/attachment_viewer.js @@ -43,6 +43,15 @@ registerModel({ onClickClose(ev) { this.close(); }, + /** + * Called when clicking on download icon. + * + * @param {MouseEvent} ev + */ + onClickDownload(ev) { + ev.stopPropagation(); + this.attachment.download(); + }, /** * @private * @returns {string}