diff options
author | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-12 16:14:16 +0200 |
---|---|---|
committer | Jörn Zaefferer <joern.zaefferer@gmail.com> | 2012-04-12 16:14:16 +0200 |
commit | 0c5c2c7055e3b1585267606da98c428942232661 (patch) | |
tree | b5377af16e867803c35d266d3f6c973326205e3c /ui/jquery.ui.position.js | |
parent | d077f9b360ebee63df48b7195780016671f2613e (diff) | |
download | jquery-ui-0c5c2c7055e3b1585267606da98c428942232661.tar.gz jquery-ui-0c5c2c7055e3b1585267606da98c428942232661.zip |
Position: Restrict the center/middle priority to target < element cases
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r-- | ui/jquery.ui.position.js | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js index bf741871b..9226909d5 100644 --- a/ui/jquery.ui.position.js +++ b/ui/jquery.ui.position.js @@ -232,10 +232,10 @@ $.fn.position = function( options ) { horizontal: right < 0 ? "left" : left > 0 ? "right" : "center", vertical: bottom < 0 ? "top" : top > 0 ? "bottom" : "middle" }; - if ( Math.abs( left + right ) < targetWidth ) { + if ( targetWidth < elemWidth && Math.abs( left + right ) < targetWidth ) { feedback.horizontal = "center"; } - if ( Math.abs( top + bottom ) < targetHeight ) { + if ( targetHeight < elemHeight && Math.abs( top + bottom ) < targetHeight ) { feedback.vertical = "middle"; } if ( Math.max( Math.abs( left ), Math.abs( right ) ) > Math.max( Math.abs( top ), Math.abs( bottom ) ) ) { |