From 2ebf060ff1ecd24cdf4de73588b4e57687e0fe0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexandre=20K=C3=BChn?= Date: Fri, 1 Apr 2022 13:52:52 +0000 Subject: [PATCH] [IMP] mail: introduce AttachmentViewer/onClickHeader Task-2579306 Part-of: odoo/odoo#88152 --- .../components/attachment_viewer/attachment_viewer.js | 11 ----------- .../attachment_viewer/attachment_viewer.xml | 2 +- addons/mail/static/src/models/attachment_viewer.js | 9 +++++++++ 3 files changed, 10 insertions(+), 12 deletions(-) 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 730a6a0cae9..c057f1a5b66 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -284,17 +284,6 @@ export class AttachmentViewer extends Component { this._stopDragging(); } - /** - * Called when clicking on the header. Stop propagation of event to prevent - * closing the dialog. - * - * @private - * @param {MouseEvent} ev - */ - _onClickHeader(ev) { - ev.stopPropagation(); - } - /** * Called when clicking on image. Stop propagation of event to prevent * closing the dialog. 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 2847ecdae30..21a10fddf4f 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml @@ -4,7 +4,7 @@
-
+
diff --git a/addons/mail/static/src/models/attachment_viewer.js b/addons/mail/static/src/models/attachment_viewer.js index aa9ab1e8357..96f8e5e1dbc 100644 --- a/addons/mail/static/src/models/attachment_viewer.js +++ b/addons/mail/static/src/models/attachment_viewer.js @@ -52,6 +52,15 @@ registerModel({ ev.stopPropagation(); this.attachment.download(); }, + /** + * Called when clicking on the header. Stop propagation of event to prevent + * closing the dialog. + * + * @param {MouseEvent} ev + */ + onClickHeader(ev) { + ev.stopPropagation(); + }, /** * @private * @returns {string}