mirror of
https://github.com/jquery/jquery-ui.git
synced 2024-11-21 11:04:24 +00:00
Position: Move Math.abs/max definitions to the top of the file
This commit is contained in:
parent
d3dc637b65
commit
be3af5bc64
12
ui/jquery.ui.position.js
vendored
12
ui/jquery.ui.position.js
vendored
@ -11,13 +11,15 @@
|
|||||||
|
|
||||||
$.ui = $.ui || {};
|
$.ui = $.ui || {};
|
||||||
|
|
||||||
var rhorizontal = /left|center|right/,
|
var cachedScrollbarWidth,
|
||||||
|
max = Math.max,
|
||||||
|
abs = Math.abs,
|
||||||
|
rhorizontal = /left|center|right/,
|
||||||
rvertical = /top|center|bottom/,
|
rvertical = /top|center|bottom/,
|
||||||
roffset = /[\+\-]\d+%?/,
|
roffset = /[\+\-]\d+%?/,
|
||||||
rposition = /^\w+/,
|
rposition = /^\w+/,
|
||||||
rpercent = /%$/,
|
rpercent = /%$/,
|
||||||
_position = $.fn.position,
|
_position = $.fn.position;
|
||||||
cachedScrollbarWidth;
|
|
||||||
|
|
||||||
function getOffsets( offsets, width, height ) {
|
function getOffsets( offsets, width, height ) {
|
||||||
return [
|
return [
|
||||||
@ -253,9 +255,7 @@ $.fn.position = function( options ) {
|
|||||||
},
|
},
|
||||||
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
|
horizontal: right < 0 ? "left" : left > 0 ? "right" : "center",
|
||||||
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
|
vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle"
|
||||||
},
|
};
|
||||||
max = Math.max,
|
|
||||||
abs = Math.abs;
|
|
||||||
if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
|
if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) {
|
||||||
feedback.horizontal = "center";
|
feedback.horizontal = "center";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user