r2976 commited - position: make it work without ui.core.js

r2976 commited - position: make it work without ui.core.js


Revision: 2976
Author: cloudream@gmail.com
Date: Sat Jul 25 12:56:11 2009
Log: position: make it work without ui.core.js
http://code.google.com/p/jquery-ui/source/detail?r=2976
Modified:
/trunk/ui/ui.position.js
=======================================
--- /trunk/ui/ui.position.js    Fri Jul 24 11:24:13 2009
+++ /trunk/ui/ui.position.js    Sat Jul 25 12:56:11 2009
@@ -9,6 +9,8 @@
*/
(function($) {
+$.ui = $.ui || {};
+
var horizontalPositions = /left|center|right/,
    horizontalDefault = 'center',
    verticalPositions = /top|center|bottom/,
@@ -20,9 +22,7 @@
        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 @@
};
$.ui.position = {
+    defaults:{
+        stackFix: true
+    },
    fit: {
        left: function(position, data) {
            var over = position.left + data.elemWidth - $(window).width() -
$(window).scrollLeft();