summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js/widgets
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-11-02 16:18:47 +0100
committerqsm-odoo <qsm@odoo.com>2017-11-02 17:02:00 +0100
commit9818f1c535217a2b70cb6f248dcc93fd7055e331 (patch)
tree521f70d4d093ec11d92d4e364ec0edbb83ec6e78 /addons/web_editor/static/src/js/widgets
parent3e63f01cf1c3acab24221f1033d5d6ae6b33303f (diff)
[FIX] web_editor: allow selecting an uploaded img without crash
Somehow, fixing multi selection with https://github.com/odoo/odoo/commit/e011d58bee140411ccfb1ef9115dddc090d573c3 broke the use of the image upload button combined with no selected image at the beginning.
Diffstat (limited to 'addons/web_editor/static/src/js/widgets')
-rw-r--r--addons/web_editor/static/src/js/widgets/widgets.js6
1 files changed, 6 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 1c2f542c6cd..f8626e33390 100644
--- a/addons/web_editor/static/src/js/widgets/widgets.js
+++ b/addons/web_editor/static/src/js/widgets/widgets.js
@@ -621,6 +621,9 @@ var fontIconsDialog = Widget.extend({
];
},
clear: function () {
+ if (!this.media) {
+ return;
+ }
this.media.className = this.media.className.replace(/(^|\s)(fa(\s|$)|fa-[^\s]*)/g, ' ');
},
});
@@ -700,6 +703,9 @@ var VideoDialog = Widget.extend({
* @override
*/
clear: function () {
+ if (!this.media) {
+ return;
+ }
if (this.media.dataset.src) {
try {
delete this.media.dataset.src;