From 651460792b3aeb7f05cbad5dc8f7b2276bdd9b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Scott=20Gonz=C3=A1lez?= Date: Fri, 17 Aug 2012 10:34:00 -0400 Subject: [PATCH] Position: Properly handle flip collision when the window is scrolled. Fixes #8481 - Position in flip mode does not take into consideration scrollTop and scrollLeft. --- ui/jquery.ui.position.js | 4 ++-- 1 file 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,