summaryrefslogtreecommitdiff
path: root/addons/web_editor/static/src/js
diff options
context:
space:
mode:
authorChristophe Matthieu <chm@odoo.com>2016-01-18 16:48:35 +0100
committerChristophe Matthieu <chm@odoo.com>2016-01-18 17:09:01 +0100
commit958656d7e678ed567ac605285f5b2f4376715e06 (patch)
tree8e14a5c1c8a600a6ea172448754177fb135e1563 /addons/web_editor/static/src/js
parentb27d24bfe9404c6013405df7dbeef69c31e9d58c (diff)
[FIX] web_editor: inliner take in care the '!important' attributes
Diffstat (limited to 'addons/web_editor/static/src/js')
-rw-r--r--addons/web_editor/static/src/js/transcoder.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/addons/web_editor/static/src/js/transcoder.js b/addons/web_editor/static/src/js/transcoder.js
index 852201c6f49..24465804bc8 100644
--- a/addons/web_editor/static/src/js/transcoder.js
+++ b/addons/web_editor/static/src/js/transcoder.js
@@ -59,6 +59,9 @@ var getMatchedCSSRules = function (a) {
var style_obj = {};
for (var k=0, len=style.length; k<len; k++) {
style_obj[style[k]] = style[style[k].replace(/-(.)/g, function (a, b) { return b.toUpperCase(); })];
+ if (new RegExp(style[k] + '\s*:[^:;]+!important' ).test(style.cssText)) {
+ style_obj[style[k]] += ' !important';
+ }
}
rulesCache[r].style = style = style_obj;
}
@@ -87,6 +90,12 @@ var getMatchedCSSRules = function (a) {
});
});
+ _.each(style, function (v,k) {
+ if (v.indexOf('important') !== -1) {
+ style[k] = v.slice(0, v.length-11);
+ }
+ });
+
if (style.display === 'block') {
delete style.display;
}