[FIX] web_editor: inliner take in care the '!important' attributes
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user