[IMP] mail: introduce AttachmentViewer/onClickHeader

Task-2579306

Part-of: odoo/odoo#88152
This commit is contained in:
Alexandre Kühn
2022-04-07 14:20:56 +02:00
parent ffd5e08d64
commit 2ebf060ff1
3 changed files with 10 additions and 12 deletions
@@ -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.
@@ -4,7 +4,7 @@
<t t-name="mail.AttachmentViewer" owl="1">
<t t-if="attachmentViewer">
<div class="o_AttachmentViewer flex-column align-items-center d-flex w-100 h-100" t-attf-class="{{ className }}" t-on-click="attachmentViewer.onClick" t-on-keydown="_onKeydown" tabindex="0" t-ref="root">
<div class="o_AttachmentViewer_header d-flex w-100 bg-black-75 text-400" t-on-click="_onClickHeader">
<div class="o_AttachmentViewer_header d-flex w-100 bg-black-75 text-400" t-on-click="attachmentViewer.onClickHeader">
<t t-if="attachmentViewer.attachment.isViewable">
<div class="o_AttachmentViewer_headerItem o_AttachmentViewer_icon d-flex align-items-center ms-4 me-2">
<t t-if="attachmentViewer.attachment.isImage">
@@ -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}