From: Alexander Ebert Date: Sun, 24 Jan 2016 16:27:13 +0000 (+0100) Subject: Fixed rules with !important incorrectly applied X-Git-Tag: 3.0.0_Beta_1~2030^2~131 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0d498c152d8241b78c74205423ffd326323b5437;p=GitHub%2FWoltLab%2FWCF.git Fixed rules with !important incorrectly applied --- diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js index 555fbebb14..3d4754e83d 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js @@ -189,9 +189,19 @@ define([], function() { * @param {Object} styles list of CSS styles */ setStyles: function(el, styles) { + var important = false; for (var property in styles) { if (styles.hasOwnProperty(property)) { - el.style.setProperty(property, styles[property]); + if (/ !important$/.test(styles[property])) { + important = true; + + styles[property] = styles[property].replace(/ !important$/, ''); + } + else { + important = false; + } + + el.style.setProperty(property, styles[property], (important ? 'important' : '')); } } },