diff options
author | Scott González <scott.gonzalez@gmail.com> | 2010-03-26 19:53:43 -0400 |
---|---|---|
committer | Scott González <scott.gonzalez@gmail.com> | 2010-03-26 19:53:43 -0400 |
commit | 9541bd0bf2ca72795e8f2b2c1d3accc32afcac96 (patch) | |
tree | 452da6246365c2022b80ed812e4765a9eb655dbb /ui | |
parent | b297b3fa6a1e4b6cba735a10ca03a6175f8eda3a (diff) | |
download | jquery-ui-9541bd0bf2ca72795e8f2b2c1d3accc32afcac96.tar.gz jquery-ui-9541bd0bf2ca72795e8f2b2c1d3accc32afcac96.zip |
Position: Use parseInt() to prevent fractional pixel values.
Fixes #5280 - ui.position generates different position in static context.
Diffstat (limited to 'ui')
-rw-r--r-- | ui/jquery.ui.position.js | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index f01640e18..11f8baa06 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -113,6 +113,10 @@ $.fn.position = function( options ) { position.top -= elemHeight / 2; } + // prevent fractions (see #5280) + position.left = parseInt( position.left ); + position.top = parseInt( position.top ); + $.each( [ "left", "top" ], function( i, dir ) { if ( $.ui.position[ collision[i] ] ) { $.ui.position[ collision[i] ][ dir ]( position, { |