Position: Properly handle flip collision when the window is scrolled. Fixes #8481 - Position in flip mode does not take into consideration scrollTop and scrollLeft.

This commit is contained in:
Scott González 2012-08-17 10:34:00 -04:00
parent af67883226
commit 651460792b

View File

@ -360,7 +360,7 @@ $.ui.position = {
var within = data.within, var within = data.within,
withinOffset = within.offset.left + within.scrollLeft, withinOffset = within.offset.left + within.scrollLeft,
outerWidth = within.width, outerWidth = within.width,
offsetLeft = within.isWindow ? 0 : within.offset.left, offsetLeft = within.isWindow ? within.scrollLeft : within.offset.left,
collisionPosLeft = position.left - data.collisionPosition.marginLeft, collisionPosLeft = position.left - data.collisionPosition.marginLeft,
overLeft = collisionPosLeft - offsetLeft, overLeft = collisionPosLeft - offsetLeft,
overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft, overRight = collisionPosLeft + data.collisionWidth - outerWidth - offsetLeft,
@ -395,7 +395,7 @@ $.ui.position = {
var within = data.within, var within = data.within,
withinOffset = within.offset.top + within.scrollTop, withinOffset = within.offset.top + within.scrollTop,
outerHeight = within.height, outerHeight = within.height,
offsetTop = within.isWindow ? 0 : within.offset.top, offsetTop = within.isWindow ? within.scrollTop : within.offset.top,
collisionPosTop = position.top - data.collisionPosition.marginTop, collisionPosTop = position.top - data.collisionPosition.marginTop,
overTop = collisionPosTop - offsetTop, overTop = collisionPosTop - offsetTop,
overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop, overBottom = collisionPosTop + data.collisionHeight - outerHeight - offsetTop,