Position: Remove at-center guards, take at:center into account instead. Fixes #8127 - collision:flip should be supported for at:center

This commit is contained in:
Jörn Zaefferer 2012-04-24 17:50:52 +02:00
parent db72cb7e94
commit c660d679b1

View File

@ -358,10 +358,6 @@ $.ui.position = {
}, },
flip: { flip: {
left: function( position, data ) { left: function( position, data ) {
if ( data.at[ 0 ] === "center" ) {
return;
}
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,
@ -377,7 +373,9 @@ $.ui.position = {
0, 0,
atOffset = data.at[ 0 ] === "left" ? atOffset = data.at[ 0 ] === "left" ?
data.targetWidth : data.targetWidth :
-data.targetWidth, data.at[ 0 ] === "right" ?
-data.targetWidth :
0,
offset = -2 * data.offset[ 0 ], offset = -2 * data.offset[ 0 ],
newOverRight, newOverRight,
newOverLeft; newOverLeft;
@ -396,10 +394,6 @@ $.ui.position = {
} }
}, },
top: function( position, data ) { top: function( position, data ) {
if ( data.at[ 1 ] === "center" ) {
return;
}
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,
@ -415,7 +409,9 @@ $.ui.position = {
0, 0,
atOffset = data.at[ 1 ] === "top" ? atOffset = data.at[ 1 ] === "top" ?
data.targetHeight : data.targetHeight :
-data.targetHeight, data.at[ 1 ] === "bottom" ?
-data.targetHeight :
0,
offset = -2 * data.offset[ 1 ], offset = -2 * data.offset[ 1 ],
newOverTop, newOverTop,
newOverBottom; newOverBottom;