From 7022406d926702b8bf86ae05a649acffe217b18c Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 4 Feb 2015 11:35:30 +0100 Subject: [PATCH] Fixed calculation for position aligned to the right boundary --- wcfsetup/install/files/js/WCF.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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), -- 2.20.1