[IMP] mail: introduce AttachmentViewer/onClickPrint

Task-2579306

Part-of: odoo/odoo#88152
This commit is contained in:
Alexandre Kühn
2022-04-07 14:20:59 +02:00
parent a1b22ae0b5
commit 513067d4e2
3 changed files with 10 additions and 12 deletions
@@ -223,17 +223,6 @@ export class AttachmentViewer extends Component {
this._stopDragging();
}
/**
* Called when clicking on print icon.
*
* @private
* @param {MouseEvent} ev
*/
_onClickPrint(ev) {
ev.stopPropagation();
this.attachmentViewer.print();
}
/**
* Called when clicking on rotate icon.
*
@@ -75,7 +75,7 @@
<div class="o_AttachmentViewer_toolbarButton btn btn-dark p-3 rounded-0" t-on-click="_onClickRotate" title="Rotate (r)" role="button">
<i class="fa fa-fw fa-repeat" role="img"/>
</div>
<div class="o_AttachmentViewer_toolbarButton btn btn-dark p-3 rounded-0" t-on-click="_onClickPrint" title="Print" role="button">
<div class="o_AttachmentViewer_toolbarButton btn btn-dark p-3 rounded-0" t-on-click="attachmentViewer.onClickPrint" title="Print" role="button">
<i class="fa fa-fw fa-print" role="img"/>
</div>
<div class="o_AttachmentViewer_buttonDownload o_AttachmentViewer_toolbarButton btn btn-dark p-3 rounded-0 o_cursor_pointer" t-on-click="attachmentViewer.onClickDownload" title="Download" role="button">
@@ -100,6 +100,15 @@ registerModel({
ev.stopPropagation();
this.previous();
},
/**
* Called when clicking on print icon.
*
* @param {MouseEvent} ev
*/
onClickPrint(ev) {
ev.stopPropagation();
this.print();
},
/**
* Called when clicking on embed video player. Stop propagation to prevent
* closing the dialog.