aboutsummaryrefslogtreecommitdiffstats
path: root/ui/jquery.ui.position.js
diff options
context:
space:
mode:
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 {