From: Chi Cheng Date: Sat, 25 Jul 2009 19:56:11 +0000 (+0000) Subject: position: make it work without ui.core.js X-Git-Tag: 1.8a1~44 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ee3a1718fb818f48b7de25266d9637c674f6e879;p=jquery-ui.git position: make it work without ui.core.js --- diff --git a/ui/ui.position.js b/ui/ui.position.js index b77e96e60..330443c47 100644 --- a/ui/ui.position.js +++ b/ui/ui.position.js @@ -9,6 +9,8 @@ */ (function($) { +$.ui = $.ui || {}; + var horizontalPositions = /left|center|right/, horizontalDefault = 'center', verticalPositions = /top|center|bottom/, @@ -20,9 +22,7 @@ $.fn.position = function(options) { return _position.apply(this, arguments); } - options = $.extend({ - stackFix: true - }, options); + options = $.extend({}, $.ui.position.defaults, options); var target = $(options.of), collision = (options.collision || 'flip').split(' '), @@ -146,6 +146,9 @@ $.fn.position = function(options) { }; $.ui.position = { + defaults:{ + stackFix: true + }, fit: { left: function(position, data) { var over = position.left + data.elemWidth - $(window).width() - $(window).scrollLeft();