Skip to content

Instantly share code, notes, and snippets.

@jiggliemon
Created July 22, 2011 06:18
Show Gist options
  • Save jiggliemon/1098976 to your computer and use it in GitHub Desktop.
Save jiggliemon/1098976 to your computer and use it in GitHub Desktop.
Mootools Events modification
var Events = new Class({
Extends: Events,
$events: {},
addEvent: function(type, fn, internal){
var events = this.$events[type] = this.$events[type] || [];
if(events == 1){
fn();
return this;
} else {
return this.parent(type,fn,internal);
}
},
fireOnce: function(type){
this.fireEvent(type);
this.$events[type] = 1;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment