[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user