Mootools lacks an easy way of checking events on objects. This is a Mootools extension to do so.
/**
* mootools additions
*/
Native.implement([Element, Window, Document], {
hasEvent: function(type) {
var events = this.retrieve('events', {});
if (events && events[type]){
return true;
} else {
return false;
}
},
getEvents: function() {
var events = this.retrieve('events', {});
if (events) {
return events;
} else {
return null;
}
}
});
Geen opmerkingen:
Een reactie posten