r2867 - positionTo: check that options.by is a function, otherwise use default positioning

r2867 - positionTo: check that options.by is a function, otherwise use default positioning


Author: joern.zaefferer
Date: Sun Jul 5 10:12:18 2009
New Revision: 2867
Modified:
branches/dev/positionTo/demos/positionTo/default.html
branches/dev/positionTo/ui/ui.positionTo.js
Log:
positionTo: check that options.by is a function, otherwise use default
positioning
Modified: branches/dev/positionTo/demos/positionTo/default.html
==============================================================================
--- branches/dev/positionTo/demos/positionTo/default.html    (original)
+++ branches/dev/positionTo/demos/positionTo/default.html    Sun Jul 5
10:12:18 2009
@@ -49,7 +49,7 @@
my: $('#my_horizontal').val() + ' ' +
$('#my_vertical').val(),
at: $('#at_horizontal').val() + ' '+
$('#at_vertical').val(),
offset: $('#offset').val(),
-                by: $.isFunction(by) && by
+                by: by
});
        }
        
Modified: branches/dev/positionTo/ui/ui.positionTo.js
==============================================================================
--- branches/dev/positionTo/ui/ui.positionTo.js    (original)
+++ branches/dev/positionTo/ui/ui.positionTo.js    Sun Jul 5 10:12:18 2009
@@ -112,7 +112,7 @@
        // the by function is passed the offset values, not the position values
        // we'll need the logic from the .offset() setter to be accessible for
        // us to calculate the position values to make the by option more useful
-        (options.by ? options.by.call(this, position) : elem.offset(position));
+        ($.isFunction(options.by) ? options.by.call(this, position) :
elem.offset(position));
    });
};