aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.position.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-12 17:48:01 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-12 17:48:01 +0200
commit8c76fe38bf1012c758bbb0bd7ae04ead4edca906 (patch)
tree9e86d4425644b1081f760572a4384c12b8701914 /ui/jquery.ui.position.js
parent1779d86b40ef2031e436710279ff09288bff1815 (diff)
downloadjquery-ui-8c76fe38bf1012c758bbb0bd7ae04ead4edca906.tar.gz
jquery-ui-8c76fe38bf1012c758bbb0bd7ae04ead4edca906.zip
Position: Inline center variable. Not necessary with gzip (or a good minifier) in place, wasn't consistent with other inline strings
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r--ui/jquery.ui.position.js23
1 files changed, 11 insertions, 12 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index 76b9cca21..27493703d 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -16,7 +16,6 @@ var rhorizontal = /left|center|right/,
roffset = /[\+\-]\d+%?/,
rposition = /^\w+/,
rpercent = /%$/,
- center = "center",
_position = $.fn.position;
$.position = {
@@ -112,13 +111,13 @@ $.fn.position = function( options ) {
if ( pos.length === 1) {
pos = rhorizontal.test( pos[ 0 ] ) ?
- pos.concat( [ center ] ) :
+ pos.concat( [ "center" ] ) :
rvertical.test( pos[ 0 ] ) ?
- [ center ].concat( pos ) :
- [ center, center ];
+ [ "center" ].concat( pos ) :
+ [ "center", "center" ];
}
- pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : center;
- pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : center;
+ pos[ 0 ] = rhorizontal.test( pos[ 0 ] ) ? pos[ 0 ] : "center";
+ pos[ 1 ] = rvertical.test( pos[ 1 ] ) ? pos[ 1 ] : "center";
// calculate offsets
horizontalOffset = roffset.exec( pos[ 0 ] );
@@ -142,13 +141,13 @@ $.fn.position = function( options ) {
if ( options.at[ 0 ] === "right" ) {
basePosition.left += targetWidth;
- } else if ( options.at[ 0 ] === center ) {
+ } else if ( options.at[ 0 ] === "center" ) {
basePosition.left += targetWidth / 2;
}
if ( options.at[ 1 ] === "bottom" ) {
basePosition.top += targetHeight;
- } else if ( options.at[ 1 ] === center ) {
+ } else if ( options.at[ 1 ] === "center" ) {
basePosition.top += targetHeight / 2;
}
@@ -171,13 +170,13 @@ $.fn.position = function( options ) {
if ( options.my[ 0 ] === "right" ) {
position.left -= elemWidth;
- } else if ( options.my[ 0 ] === center ) {
+ } else if ( options.my[ 0 ] === "center" ) {
position.left -= elemWidth / 2;
}
if ( options.my[ 1 ] === "bottom" ) {
position.top -= elemHeight;
- } else if ( options.my[ 1 ] === center ) {
+ } else if ( options.my[ 1 ] === "center" ) {
position.top -= elemHeight / 2;
}
@@ -336,7 +335,7 @@ $.ui.position = {
},
flip: {
left: function( position, data ) {
- if ( data.at[ 0 ] === center ) {
+ if ( data.at[ 0 ] === "center" ) {
return;
}
@@ -376,7 +375,7 @@ $.ui.position = {
}
},
top: function( position, data ) {
- if ( data.at[ 1 ] === center ) {
+ if ( data.at[ 1 ] === "center" ) {
return;
}