[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.
This commit is contained in:
qsm-odoo
2017-11-02 17:02:00 +01:00
parent 3e63f01cf1
commit 9818f1c535
@@ -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;