summaryrefslogtreecommitdiff
path: root/theme_common/static/src/js/compatibility_editor.js
diff options
context:
space:
mode:
authorRichard Sassine <richardsassine@tutanota.com>2021-05-04 18:00:38 +0300
committerRichard Sassine <richardsassine@tutanota.com>2021-05-04 18:00:38 +0300
commitad97722b1b35aff50d0adf13a19715f7b8373c07 (patch)
treeedf36f1114b896a01602e31dafd74efe45736427 /theme_common/static/src/js/compatibility_editor.js
initial commit
Diffstat (limited to 'theme_common/static/src/js/compatibility_editor.js')
-rw-r--r--theme_common/static/src/js/compatibility_editor.js19
1 files changed, 19 insertions, 0 deletions
diff --git a/theme_common/static/src/js/compatibility_editor.js b/theme_common/static/src/js/compatibility_editor.js
new file mode 100644
index 0000000..0f3aeb3
--- /dev/null
+++ b/theme_common/static/src/js/compatibility_editor.js
@@ -0,0 +1,19 @@
+odoo.define('theme_common.compatibility_editor', function (require) {
+'use strict';
+
+var sOptions = require('web_editor.snippets.options');
+
+sOptions.registry.BackgroundImage.include({
+ /**
+ * @override
+ */
+ background: function (previewMode, widgetValue, params) {
+ this._super.apply(this, arguments);
+
+ var customClass = this.$target.attr('class').match(/\b(bg-img-\d+)\b/);
+ if (customClass) {
+ this.$target.removeClass(customClass[1]);
+ }
+ },
+});
+});