summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src
diff options
context:
space:
mode:
authorSamuel Degueldre <sad@odoo.com>2020-09-17 07:44:43 +0000
committerqsm-odoo <qsm@odoo.com>2021-01-04 15:56:25 +0000
commit4d3655304205cc9785ef696a47a17a41242d297a (patch)
tree865c7c0d52786005f9dfaae381ea89d5eff190ce /addons/web_editor/static/src
parent64de68b4420eb4d82ff2130dfaa310e40775a0b7 (diff)
[FIX] web_editor: don't reoptimize already optimized image if repicked
Previously, if you double-clicked an image in the web editor with the intention to change it, but the image had already been optimized, and then repicked the same, already optimized image, the image would be optimized again even though it had not changed. This commit fixes that by making the media-dialog not trigger an image_changed event in those cases, and by leaving the initial image untouched. Linked to issue #57604 closes odoo/odoo#57910 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src')
-rw-r--r--addons/web_editor/static/src/js/wysiwyg/widgets/media.js2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
index ed33b79240a..628992206a6 100644
--- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
+++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
@@ -412,7 +412,7 @@ var FileWidget = SearchableMediaWidget.extend({
}
const img = selected[0];
- if (!img || !img.id) {
+ if (!img || !img.id || this.$media.attr('src') === img.image_src) {
return this.media;
}