diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-20 14:09:17 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-20 14:09:17 +0200 |
commit | be3af5bc64c125ac933a7d80300884fe5bb83e24 (patch) | |
tree | bbb84db38cdf7013111d5625415b22b6e4157d5f /ui/jquery.ui.position.js | |
parent | d3dc637b657b9e491c24a5d1ccd278178f102844 (diff) | |
download | jquery-ui-be3af5bc64c125ac933a7d80300884fe5bb83e24.tar.gz jquery-ui-be3af5bc64c125ac933a7d80300884fe5bb83e24.zip |
Position: Move Math.abs/max definitions to the top of the file
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index 5be90dcfe..ea176688e 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -11,13 +11,15 @@ $.ui = $.ui || {}; -var rhorizontal = /left|center|right/, +var cachedScrollbarWidth, + max = Math.max, + abs = Math.abs, + rhorizontal = /left|center|right/, rvertical = /top|center|bottom/, roffset = /[\+\-]\d+%?/, rposition = /^\w+/, rpercent = /%$/, - _position = $.fn.position, - cachedScrollbarWidth; + _position = $.fn.position; function getOffsets( offsets, width, height ) { return [ @@ -253,9 +255,7 @@ $.fn.position = function( options ) { }, horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" - }, - max = Math.max, - abs = Math.abs; + }; if ( targetWidth < elemWidth && abs( left + right ) < targetWidth ) { feedback.horizontal = "center"; } |