diff options
| author | Christophe Matthieu <chm@odoo.com> | 2016-01-18 16:48:35 +0100 |
|---|---|---|
| committer | Christophe Matthieu <chm@odoo.com> | 2016-01-18 17:09:01 +0100 |
| commit | 958656d7e678ed567ac605285f5b2f4376715e06 (patch) | |
| tree | 8e14a5c1c8a600a6ea172448754177fb135e1563 | |
| parent | b27d24bfe9404c6013405df7dbeef69c31e9d58c (diff) | |
[FIX] web_editor: inliner take in care the '!important' attributes
| -rw-r--r-- | addons/web_editor/static/src/js/transcoder.js | 9 |
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; } |
