aboutsummaryrefslogtreecommitdiffstats
path: root/ui/position.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/position.js')
-rw-r--r--ui/position.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/ui/position.js b/ui/position.js
index 2d1969599..2bd814d93 100644
--- a/ui/position.js
+++ b/ui/position.js
@@ -148,7 +148,12 @@ $.fn.position = function( options ) {
options = $.extend( {}, options );
var atOffset, targetWidth, targetHeight, targetOffset, basePosition, dimensions,
- target = $( options.of ),
+
+ // Make sure string options are treated as CSS selectors
+ target = typeof options.of === "string" ?
+ $( document ).find( options.of ) :
+ $( options.of ),
+
within = $.position.getWithinInfo( options.within ),
scrollInfo = $.position.getScrollInfo( within ),
collision = ( options.collision || "flip" ).split( " " ),