diff options
| author | Nicolas Lempereur <nle@odoo.com> | 2019-05-31 13:06:50 +0000 |
|---|---|---|
| committer | Nicolas Lempereur <nle@odoo.com> | 2019-05-31 13:26:50 +0000 |
| commit | 9e6f3abead075bf511ba52cf654e776d04b1d3d5 (patch) | |
| tree | b06b2fa0581894a6283fcea7a06281b9b1dc45c2 /addons | |
| parent | 8f21148e1a8eaae3bc09ec54377becb2361e7834 (diff) | |
[FIX] web_editor: image modal nochange close on save
When you open the image modal of the website editor the selected image
is the current image.
But if the image is not an attachment with an `url` field set (eg. it
has been uploaded and is not a file in a /static/ folder) the match
between image modal and current did not work and to close it we need to:
- actively select the current image then click "Save"
- use the X button to close the modal without saving
With this changeset, the match of current image with image list is done
on the attachment `url` and if unavailable with /web/image/ID/name.jpg
path which cover both possibilities.
opw-2004073
closes #33799
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/web_editor/static/src/js/widgets/widgets.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js index 43bc2e95199..8e5e0787369 100644 --- a/addons/web_editor/static/src/js/widgets/widgets.js +++ b/addons/web_editor/static/src/js/widgets/widgets.js @@ -255,7 +255,7 @@ var ImageWidget = MediaWidget.extend({ o.id = +o.url.match(/\/web\/content\/(\d+)/, '')[1]; } if (o.url) { - self._toggleImage(_.find(self.records, function (record) { return record.url === o.url;}) || o, true); + self._toggleImage(_.find(self.records, function (record) { return record.src === o.url;}) || o, true); } return def; |
