From d077f9b360ebee63df48b7195780016671f2613e Mon Sep 17 00:00:00 2001 From: Jörn Zaefferer Date: Thu, 12 Apr 2012 01:32:30 +0200 Subject: Position: Improve feedback API by giving the center/middle position more weight. Also removed themeswitcher from test pages, now load faster --- ui/jquery.ui.position.js | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'ui/jquery.ui.position.js') 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 { -- cgit v1.2.3