Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- YUI.add('event-handler', function(Y) {
- var YArray = Y.Array;
- function EventHandler() {}
- //Y.Base.prototype.eventHandler = {
- Y.mix(EventHandler.prototype, {
- add : function(event) {
- this.events = this.events || [];
- if (Y.Lang.isArray(event)) {
- YArray.each(event, function(ev) {
- this.events.push(ev);
- }, this);
- } else {
- this.events.push(event);
- }
- },
- destroy : function() {
- YArray.each(this.events, function(eh) {
- eh.detach();
- });
- }
- });
- Y.EventHandler = EventHandler();
- });
Add Comment
Please, Sign In to add comment