diff options
Diffstat (limited to 'addons/web_editor/static/src')
| -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; } |
