From: Alexander Ebert Date: Wed, 4 Feb 2015 10:35:30 +0000 (+0100) Subject: Fixed calculation for position aligned to the right boundary X-Git-Tag: 2.1.0_RC_1~83^2~1 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7022406d926702b8bf86ae05a649acffe217b18c;p=GitHub%2FWoltLab%2FWCF.git Fixed calculation for position aligned to the right boundary --- diff --git a/wcfsetup/install/files/js/WCF.js b/wcfsetup/install/files/js/WCF.js index 7383d003b4..30c0bc96c2 100755 --- a/wcfsetup/install/files/js/WCF.js +++ b/wcfsetup/install/files/js/WCF.js @@ -1623,7 +1623,7 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ $left = this._getPositionLeft($elementOffsets, $dropdownDimensions, $pageWidth); if (!$left.result) { - $right = this._getPositionRight($elementOffsets, $dropdownDimensions, $elementDimensions); + $right = this._getPositionRight($elementOffsets, $dropdownDimensions, $elementDimensions, $pageWidth); if ($right.result) { $left = null; @@ -1634,7 +1634,7 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ } } else { - $right = this._getPositionRight($elementOffsets, $dropdownDimensions, $elementDimensions); + $right = this._getPositionRight($elementOffsets, $dropdownDimensions, $elementDimensions, $pageWidth); if (!$right.result) { $left = this._getPositionLeft($elementOffsets, $dropdownDimensions, $pageWidth); @@ -1695,11 +1695,12 @@ WCF.Dropdown.Interactive.Instance = Class.extend({ * @param object elementOffsets * @param object dropdownDimensions * @param object elementDimensions + * @param integer pageWidth * @return object */ - _getPositionRight: function(elementOffsets, dropdownDimensions, elementDimensions) { + _getPositionRight: function(elementOffsets, dropdownDimensions, elementDimensions, pageWidth) { var $left = (elementOffsets.left + elementDimensions.width) - dropdownDimensions.width; - var $right = elementOffsets.right; + var $right = pageWidth - (elementOffsets.left + elementDimensions.width); return { result: ($left > 0),