aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.position.js
diff options
context:
space:
mode:
authorJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-12 01:32:30 +0200
committerJörn Zaefferer <joern.zaefferer@gmail.com>2012-04-12 01:32:30 +0200
commitd077f9b360ebee63df48b7195780016671f2613e (patch)
tree2da3004d12524d776aeaeea2477b5648de353503 /ui/jquery.ui.position.js
parent260261255baa3c891d265cf2266e66cbc2ac88b6 (diff)
downloadjquery-ui-d077f9b360ebee63df48b7195780016671f2613e.tar.gz
jquery-ui-d077f9b360ebee63df48b7195780016671f2613e.zip
Position: Improve feedback API by giving the center/middle position more weight. Also removed themeswitcher from test pages, now load faster
Diffstat (limited to 'ui/jquery.ui.position.js')
-rw-r--r--ui/jquery.ui.position.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/ui/jquery.ui.position.js b/ui/jquery.ui.position.js
index 025d2c815..bf741871b 100644
--- a/ui/jquery.ui.position.js
+++ b/ui/jquery.ui.position.js
@@ -232,6 +232,12 @@ $.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 ) {
+ feedback.horizontal = "center";
+ }
+ if ( 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 ) ) ) {
feedback.important = "horizontal";
} else {