From: Marcel Werk Date: Mon, 14 Nov 2016 12:25:22 +0000 (+0100) Subject: Fixed calculation of positions in IE11 X-Git-Tag: 3.0.0_Beta_5~56 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=39c81ccedf519943872d984e0ce6838fd4550953;p=GitHub%2FWoltLab%2FWCF.git Fixed calculation of positions in IE11 --- diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js index 393204d929..089c1b6f96 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/Style/Editor.js @@ -136,7 +136,7 @@ define(['Ajax', 'Core', 'Dictionary', 'Dom/Util', 'EventHandler', 'Ui/Screen'], var region = _stylePreviewRegions.get(lastValue); var rect = region.getBoundingClientRect(); - var top = rect.top + window.scrollY; + var top = rect.top + (window.scrollY || window.pageYOffset); DomUtil.setStyles(_stylePreviewRegionMarker, { height: (region.clientHeight + 20) + 'px', diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Alignment.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Alignment.js index d7c0755865..91c691abb6 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Alignment.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Alignment.js @@ -236,13 +236,13 @@ define(['Core', 'Language', 'Dom/Traverse', 'Dom/Util'], function(Core, Language if (align === 'top') { var bodyHeight = document.body.clientHeight; bottom = (bodyHeight - refOffsets.top) + verticalOffset; - if (bodyHeight - (bottom + elDimensions.height) < window.scrollY) { + if (bodyHeight - (bottom + elDimensions.height) < (window.scrollY || window.pageYOffset)) { result = false; } } else { top = refOffsets.top + refDimensions.height + verticalOffset; - if (top + elDimensions.height - window.scrollY > windowHeight) { + if (top + elDimensions.height - (window.scrollY || window.pageYOffset) > windowHeight) { result = false; } } diff --git a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js index a5f0ece54e..ae8c06301d 100644 --- a/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js +++ b/wcfsetup/install/files/js/WoltLabSuite/Core/Ui/Redactor/Mention.js @@ -134,12 +134,12 @@ define(['Ajax', 'Environment', 'Ui/CloseOverlay'], function(Ajax, Environment, U // get the offsets of the bounding box of current text selection var rect = data.selection.getRangeAt(0).getBoundingClientRect(); var offsets = { - top: Math.round(rect.bottom) + window.scrollY, + top: Math.round(rect.bottom) + (window.scrollY || window.pageYOffset), left: Math.round(rect.left) + document.body.scrollLeft }; if (this._lineHeight === null) { - this._lineHeight = Math.round(rect.bottom - rect.top - window.scrollY); + this._lineHeight = Math.round(rect.bottom - rect.top - (window.scrollY || window.pageYOffset)); } // restore caret position @@ -311,7 +311,7 @@ define(['Ajax', 'Environment', 'Ui/CloseOverlay'], function(Ajax, Environment, U this._selectItem(0); - if (offset.top + this._dropdownMenu.offsetHeight + 10 > window.innerHeight + window.scrollY) { + if (offset.top + this._dropdownMenu.offsetHeight + 10 > window.innerHeight + (window.scrollY || window.pageYOffset)) { this._dropdownMenu.style.setProperty('top', offset.top - this._dropdownMenu.offsetHeight - 2 * this._lineHeight + 7 + 'px', ''); } },