Skip to content

Instantly share code, notes, and snippets.

@zohararad
Created May 25, 2013 08:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save zohararad/5648378 to your computer and use it in GitHub Desktop.
Save zohararad/5648378 to your computer and use it in GitHub Desktop.
Zepto.queue support for Spine.Ajax
$.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