[IMP] mail: introduce AttachmentViewer/onClickPrevious

Task-2579306

Part-of: odoo/odoo#88152
This commit is contained in:
Alexandre Kühn
2022-04-07 14:20:59 +02:00
parent 1d7a4b7891
commit a1b22ae0b5
3 changed files with 10 additions and 12 deletions
@@ -223,17 +223,6 @@ export class AttachmentViewer extends Component {
this._stopDragging();
}
/**
* Called when clicking on previous icon.
*
* @private
* @param {MouseEvent} ev
*/
_onClickPrevious(ev) {
ev.stopPropagation();
this.attachmentViewer.previous();
}
/**
* Called when clicking on print icon.
*
@@ -84,7 +84,7 @@
</div>
</t>
<t t-if="attachmentViewer.attachments.length > 1">
<div class="o_AttachmentViewer_buttonNavigation o_AttachmentViewer_buttonNavigationPrevious o_AttachmentViewer_buttonNavigationPreviousIcon btn btn-dark position-absolute top-0 bottom-0 start-0 align-items-center justify-content-center d-flex my-auto ms-3 rounded-circle" t-on-click="_onClickPrevious" title="Previous (Left-Arrow)" role="button">
<div class="o_AttachmentViewer_buttonNavigation o_AttachmentViewer_buttonNavigationPrevious o_AttachmentViewer_buttonNavigationPreviousIcon btn btn-dark position-absolute top-0 bottom-0 start-0 align-items-center justify-content-center d-flex my-auto ms-3 rounded-circle" t-on-click="attachmentViewer.onClickPrevious" title="Previous (Left-Arrow)" role="button">
<span class="fa fa-chevron-left" role="img"/>
</div>
<div class="o_AttachmentViewer_buttonNavigation o_AttachmentViewer_buttonNavigationNext o_AttachmentViewer_buttonNavigationNextIcon btn btn-dark position-absolute top-0 bottom-0 end-0 align-items-center justify-content-center d-flex my-auto me-3 rounded-circle" t-on-click="attachmentViewer.onClickNext" title="Next (Right-Arrow)" role="button">
@@ -91,6 +91,15 @@ registerModel({
ev.stopPropagation();
this.next();
},
/**
* Called when clicking on previous icon.
*
* @param {MouseEvent} ev
*/
onClickPrevious(ev) {
ev.stopPropagation();
this.previous();
},
/**
* Called when clicking on embed video player. Stop propagation to prevent
* closing the dialog.