mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
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:
parent
af67883226
commit
651460792b
4
ui/jquery.ui.position.js
vendored
4
ui/jquery.ui.position.js
vendored
@ -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,
|
||||||
|
Loading…
Reference in New Issue
Block a user