diff options
Diffstat (limited to 'addons/mail/static/src/components/attachment/attachment.js')
| -rw-r--r-- | addons/mail/static/src/components/attachment/attachment.js | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/addons/mail/static/src/components/attachment/attachment.js b/addons/mail/static/src/components/attachment/attachment.js index a1c05fb8c62..a4b7b1363fe 100644 --- a/addons/mail/static/src/components/attachment/attachment.js +++ b/addons/mail/static/src/components/attachment/attachment.js @@ -94,10 +94,18 @@ class Attachment extends Component { if (this.detailsMode === 'card') { size = '38x38'; } else { - size = '160x160'; + // The size of background-image depends on the props.imageSize + // to sync with width and height of `.o_Attachment_image`. + if (this.props.imageSize === "large") { + size = '400x400'; + } else if (this.props.imageSize === "medium") { + size = '200x200'; + } else if (this.props.imageSize === "small") { + size = '100x100'; + } } // background-size set to override value from `o_image` which makes small image stretched - return `background-image:url(/web/image/${this.attachment.id}/${size}/?crop=true); background-size: auto;`; + return `background-image:url(/web/image/${this.attachment.id}/${size}); background-size: auto;`; } //-------------------------------------------------------------------------- |
