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 9a05bbf6956..476c2860f12 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.js @@ -93,13 +93,13 @@ export class AttachmentViewer extends Component { * @private */ _handleImageLoad() { - if (!this.attachmentViewer.exists() || !this.attachmentViewer.attachment) { + if (!this.attachmentViewer.exists() || !this.attachmentViewer.attachmentViewerViewable) { return; } const refs = this._getRefs(); - const image = refs[`image_${this.attachmentViewer.attachment.id}`]; + const image = refs[`image_${this.attachmentViewer.attachmentViewerViewable.localId}`]; if ( - this.attachmentViewer.attachment.isImage && + this.attachmentViewer.attachmentViewerViewable.isImage && (!image || !image.complete) ) { this.attachmentViewer.update({ isImageLoading: true }); @@ -142,7 +142,7 @@ export class AttachmentViewer extends Component { _updateZoomerStyle() { const attachmentViewer = this.attachmentViewer; const refs = this._getRefs(); - const image = refs[`image_${this.attachmentViewer.attachment.id}`]; + const image = refs[`image_${this.attachmentViewer.attachmentViewerViewable.localId}`]; const tx = image.offsetWidth * attachmentViewer.scale > this._zoomerRef.el.offsetWidth ? this._translate.x + this._translate.dx : 0; 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 d92ff351df5..994f3dd9072 100644 --- a/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml +++ b/addons/mail/static/src/components/attachment_viewer/attachment_viewer.xml @@ -5,24 +5,24 @@
- +
- + - + - + - +
- +
@@ -35,33 +35,33 @@
-
- +
+
- Viewer + Viewer
- -