aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott González <scott.gonzalez@gmail.com>2012-08-17 10:34:00 -0400
committerScott González <scott.gonzalez@gmail.com>2012-08-17 10:34:00 -0400
commit651460792b3aeb7f05cbad5dc8f7b2276bdd9b29 (patch)
tree51f04912bfd3857e5b8f710c67440f5ab8c1d5de
parentaf67883226954114ef4782f81d1b6360d6516ee9 (diff)
downloadjquery-ui-651460792b3aeb7f05cbad5dc8f7b2276bdd9b29.tar.gz
jquery-ui-651460792b3aeb7f05cbad5dc8f7b2276bdd9b29.zip
Position: Properly handle flip collision when the window is scrolled. Fixes #8481 - Position in flip mode does not take into consideration scrollTop and scrollLeft.
-rw-r--r--ui/jquery.ui.position.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index eef8a95c9..2e2fe215a 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -360,7 +360,7 @@ $.ui.position = {
var within = data.within,
withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width,
- offsetLeft = within.isWindow ? 0 : within.offset.left,
+ offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = collisionPosLeft - offsetLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
@@ -395,7 +395,7 @@ $.ui.position = {
var within = data.within,
withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height,
- offsetTop = within.isWindow ? 0 : within.offset.top,
+ offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = collisionPosTop - offsetTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,