Created
May 25, 2013 08:38
-
-
Save zohararad/5648378 to your computer and use it in GitHub Desktop.
Zepto.queue support for Spine.Ajax
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.queue = function(){ | |
var Q = function(){ | |
this.q = []; | |
} | |
Q.prototype = { | |
enqueue: function(el){ | |
if($.isArray(el)){ | |
this.q = el; | |
} else { | |
this.q.push(el); | |
} | |
return this.q; | |
}, | |
queue: function(){ | |
var args = Array.prototype.slice.call(arguments, 0); | |
if(args.length === 0){ | |
return this.q; | |
} else { | |
return this.enqueue.apply(this,args); | |
} | |
} | |
} | |
this.q = this.q || new Q(); | |
var args = Array.prototype.slice.call(arguments, 0); | |
return this.q.queue.apply(this.q, args); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment