Check-in Number:
|
11 | |
Date: |
2007-Mar-13 18:14:37 (local)
2007-Mar-13 17:14:37 (UTC) |
User: | rse |
Branch: | |
Comment: |
allow flexibile calling convention also for method
|
Tickets: |
|
Inspections: |
|
Files: |
|
Modified: jquery/jquery.schedule.js
===================================================================
--- jquery/jquery.schedule.js 2007-03-12 15:15:13 UTC (rev 10)
+++ jquery/jquery.schedule.js 2007-03-13 17:14:37 UTC (rev 11)
@@ -192,20 +192,29 @@
schedule: function () {
var a = arguments;
return this.each(function () {
- var time = a[0];
- var func = a[1];
- var args = [];
- for (var i = 2; i < a.length; i++)
- args.push(a[i]);
- return jQuery.schedule({
- id: this,
- repeat: false,
- protect: false,
- time: time,
- obj: this,
- func: func,
- args: args
- });
+ if (typeof a[0] == "object") {
+ if (typeof a[0].id == "undefined")
+ a[0].id = this;
+ if (typeof a[0].obj == "undefined")
+ a[0].obj = this;
+ return jQuery.schedule(a[0]);
+ }
+ else {
+ var time = a[0];
+ var func = a[1];
+ var args = [];
+ for (var i = 2; i < a.length; i++)
+ args.push(a[i]);
+ return jQuery.schedule({
+ id: this,
+ repeat: false,
+ protect: false,
+ time: time,
+ obj: this,
+ func: func,
+ args: args
+ });
+ }
});
}
});