Skip to content

Instantly share code, notes, and snippets.

@bryanjswift
Created July 31, 2008 16:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryanjswift/3478 to your computer and use it in GitHub Desktop.
Save bryanjswift/3478 to your computer and use it in GitHub Desktop.
Window.implement({
fireEvent: function(type, args, delay){
var events = this.retrieve('events');
if (!events || !events[type]) return this;
events[type].keys.each(function(fn){
fn.create({'bind': this, 'delay': delay, 'arguments': args})();
}, this);
if (type === 'domready') this.fireEvent('afterDomready');
return this;
}
});
Window.implement({
fireEvent: function(type, args, delay){
var events = this.retrieve('events');
if (!events || !events[type]) return this;
events[type].keys.each(function(fn){
fn.create({'bind': this, 'delay': delay, 'arguments': args})();
}, this);
if (!type.test(/^after/)) this.fireEvent('after' + type.capitalize());
return this;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment