mirror of
https://github.com/jquery/jquery-ui.git
synced 2025-01-07 20:34:24 +00:00
Update var name to avoid confusion
This commit is contained in:
parent
e31d707d93
commit
2f4da6f13d
40
ui/jquery.ui.position.js
vendored
40
ui/jquery.ui.position.js
vendored
@ -185,12 +185,12 @@ $.fn.position = function( options ) {
|
|||||||
$.ui.position = {
|
$.ui.position = {
|
||||||
fit: {
|
fit: {
|
||||||
left: function( position, data ) {
|
left: function( position, data ) {
|
||||||
var win = data.within,
|
var within = data.within,
|
||||||
isWindow = $.isWindow( data.within[0] ),
|
isWindow = $.isWindow( data.within[0] ),
|
||||||
winOffset = isWindow ? 0 : win.offset().left,
|
withinOffset = isWindow ? 0 : within.offset().left,
|
||||||
outerWidth = isWindow ? win.width() : win.outerWidth(),
|
outerWidth = isWindow ? within.width() : within.outerWidth(),
|
||||||
overLeft = win.scrollLeft() - data.collisionPosition.left + winOffset,
|
overLeft = within.scrollLeft() - data.collisionPosition.left + withinOffset,
|
||||||
overRight = data.collisionPosition.left + data.collisionWidth - outerWidth - win.scrollLeft() - winOffset;
|
overRight = data.collisionPosition.left + data.collisionWidth - outerWidth - within.scrollLeft() - withinOffset;
|
||||||
|
|
||||||
// element is wider than window or too far left -> align with left edge
|
// element is wider than window or too far left -> align with left edge
|
||||||
if ( data.collisionWidth > outerWidth || overLeft > 0 ) {
|
if ( data.collisionWidth > outerWidth || overLeft > 0 ) {
|
||||||
@ -204,12 +204,12 @@ $.ui.position = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
top: function( position, data ) {
|
top: function( position, data ) {
|
||||||
var win = data.within,
|
var within = data.within,
|
||||||
isWindow = $.isWindow( data.within[0] ),
|
isWindow = $.isWindow( data.within[0] ),
|
||||||
winOffset = isWindow ? 0 : win.offset().top,
|
withinOffset = isWindow ? 0 : within.offset().top,
|
||||||
outerHeight = isWindow ? win.height() : win.outerHeight(),
|
outerHeight = isWindow ? within.height() : within.outerHeight(),
|
||||||
overTop = win.scrollTop() - data.collisionPosition.top + winOffset,
|
overTop = within.scrollTop() - data.collisionPosition.top + withinOffset,
|
||||||
overBottom = data.collisionPosition.top + data.collisionHeight - outerHeight - win.scrollTop() - winOffset;
|
overBottom = data.collisionPosition.top + data.collisionHeight - outerHeight - within.scrollTop() - withinOffset;
|
||||||
|
|
||||||
// element is taller than window or too far up -> align with top edge
|
// element is taller than window or too far up -> align with top edge
|
||||||
if ( data.collisionHeight > outerHeight || overTop > 0 ) {
|
if ( data.collisionHeight > outerHeight || overTop > 0 ) {
|
||||||
@ -229,12 +229,12 @@ $.ui.position = {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var win = data.within,
|
var within = data.within,
|
||||||
isWindow = $.isWindow( data.within[0] ),
|
isWindow = $.isWindow( data.within[0] ),
|
||||||
winOffset = isWindow ? 0 : win.offset().left,
|
withinOffset = isWindow ? 0 : within.offset().left,
|
||||||
outerWidth = isWindow ? win.width() : win.outerWidth(),
|
outerWidth = isWindow ? within.width() : within.outerWidth(),
|
||||||
overLeft = data.collisionPosition.left - winOffset,
|
overLeft = data.collisionPosition.left - withinOffset,
|
||||||
overRight = data.collisionPosition.left + data.collisionWidth - outerWidth - win.scrollLeft() - winOffset,
|
overRight = data.collisionPosition.left + data.collisionWidth - outerWidth - within.scrollLeft() - withinOffset,
|
||||||
left = data.my[ 0 ] === "left",
|
left = data.my[ 0 ] === "left",
|
||||||
myOffset = data.my[ 0 ] === "left" ?
|
myOffset = data.my[ 0 ] === "left" ?
|
||||||
-data.elemWidth :
|
-data.elemWidth :
|
||||||
@ -253,12 +253,12 @@ $.ui.position = {
|
|||||||
if ( data.at[ 1 ] === center ) {
|
if ( data.at[ 1 ] === center ) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var win = data.within,
|
var within = data.within,
|
||||||
isWindow = $.isWindow( data.within[0] ),
|
isWindow = $.isWindow( data.within[0] ),
|
||||||
winOffset = isWindow ? 0 : win.offset().top,
|
withinOffset = isWindow ? 0 : within.offset().top,
|
||||||
outerHeight = isWindow ? win.height() : win.outerHeight(),
|
outerHeight = isWindow ? within.height() : within.outerHeight(),
|
||||||
overTop = data.collisionPosition.top - winOffset,
|
overTop = data.collisionPosition.top - withinOffset,
|
||||||
overBottom = data.collisionPosition.top + data.collisionHeight - outerHeight - win.scrollTop() - winOffset,
|
overBottom = data.collisionPosition.top + data.collisionHeight - outerHeight - within.scrollTop() - withinOffset,
|
||||||
top = data.my[ 1 ] === "top",
|
top = data.my[ 1 ] === "top",
|
||||||
myOffset = top ?
|
myOffset = top ?
|
||||||
-data.elemHeight :
|
-data.elemHeight :
|
||||||
|
Loading…
Reference in New Issue
Block a user