From 3274a36afd0eda64242da8202ff488eae2000f66 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 28 Jul 2016 20:59:12 +0200 Subject: [PATCH] Some more fixes for IE and Edge Obviously Safari and Edge are equally garbage now, yay! --- wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js index 3427d48026..ef64f2bb4b 100644 --- a/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js +++ b/wcfsetup/install/files/js/WoltLab/WCF/Dom/Util.js @@ -154,8 +154,8 @@ define(['Environment', 'StringUtil'], function(Environment, StringUtil) { var rect = el.getBoundingClientRect(); return { - top: rect.top + window.pageYOffset, - left: rect.left + window.pageXOffset + top: Math.round(rect.top + (window.scrollY || window.pageYOffset)), + left: Math.round(rect.left + (window.scrollX || window.pageXOffset)) }; }, @@ -198,7 +198,7 @@ define(['Environment', 'StringUtil'], function(Environment, StringUtil) { setStyles: function(el, styles) { var important = false; for (var property in styles) { - if (objOwns(styles, property)) { + if (styles.hasOwnProperty(property)) { if (/ !important$/.test(styles[property])) { important = true; @@ -208,10 +208,10 @@ define(['Environment', 'StringUtil'], function(Environment, StringUtil) { important = false; } - // for a set style property with priority = important, Safari is not able to - // overwrite it with a property != important; removing the property first - // solves the issue - if (Environment.browser() === 'safari' && el.style.getPropertyPriority(property) === 'important' && !important) { + // for a set style property with priority = important, some browsers are + // not able to overwrite it with a property != important; removing the + // property first solves this issue + if (el.style.getPropertyPriority(property) === 'important' && !important) { el.style.removeProperty(property); } -- 2.20.1