From 0d498c152d8241b78c74205423ffd326323b5437 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Sun, 24 Jan 2016 17:27:13 +0100 Subject: [PATCH] Fixed rules with !important incorrectly applied --- wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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' : '')); } } }, -- 2.20.1