summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorNicolas Lempereur <nle@odoo.com>2019-06-03 13:52:04 +0000
committerNicolas Lempereur <nle@odoo.com>2019-06-03 13:54:45 +0000
commit7c900568c5fdf4dece09055c2b9f26ecd1214c72 (patch)
tree012ffea9c4e2fd7e7c8c61a5f73415c0eee7f64e /addons/web_editor/static/src/js
parent8a0e819d0bb0e4184ed64559b7be91605d044e19 (diff)
[FIX] web_editor: modal open>save document keep it
When we add a document with the "Select a Media" modal, if we reopen the modal then click on "Save" without modfiying anything, the element is broken since we do not have the data saying it is a document and the code try to display it as image. With this changeset, we keep the information that the attachment is a document and when saving it works as expected. opw-2004064 closes #33844 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js1
1 files changed, 1 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/widgets/widgets.js b/addons/web_editor/static/src/js/widgets/widgets.js
index 27a5e41d06a..4dfe574c52e 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -253,6 +253,7 @@ var ImageWidget = MediaWidget.extend({
} else if (this.$media.is('a.o_image')) {
o.url = this.$media.attr('href').replace(/[?].*/, '');
o.id = +o.url.match(/\/web\/content\/(\d+)/, '')[1];
+ o.isDocument = true;
}
if (o.url) {
self._toggleImage(_.find(self.records, function (record) { return record.url === o.url;}) || o, true);