summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2020-10-16 15:50:09 +0000
committerqsm-odoo <qsm@odoo.com>2020-10-16 17:14:11 +0000
commit078308b25b9eb9a456daac28815dca8f40ed0c33 (patch)
treec30288d384b31ec9f209ec2ec8a5ff03c3b573fb /addons/web_editor/static/src/js
parentc8c828ee14533176cfef5b2e7d29344286af74be (diff)
[FIX] web_editor: keep `<i/>` elements after icon edition
Any non `<span/>` element which was transformed into an icon thanks to the media dialog was transform into a `<span/>` then processed by summernote. In some cases, this processing breaks the DOM... for no reason as the DOM should not have been transformed into a `<span/>` in the first place: `<i/>` elements inside a `<span/>` for example should stay `<i/>` elements after edition. closes odoo/odoo#60200 X-original-commit: 4bfcb80e3664ccc74b7ec5e7e10ace6e44ab98d3 Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Diffstat (limited to 'addons/web_editor/static/src/js')
-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 9c284931bf6..d074e5d9c38 100644
--- a/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
+++ b/addons/web_editor/static/src/js/wysiwyg/widgets/media.js
@@ -1049,7 +1049,7 @@ var IconWidget = SearchableMediaWidget.extend({
var style = this.$media.attr('style') || '';
var iconFont = this._getFont(this.selectedIcon) || {base: 'fa', font: ''};
var finalClasses = _.uniq(this.nonIconClasses.concat([iconFont.base, iconFont.font]));
- if (!this.$media.is('span')) {
+ if (!this.$media.is('span, i')) {
var $span = $('<span/>');
$span.data(this.$media.data());
this.$media = $span;