Created
October 7, 2010 02:09
-
-
Save tstachl/614433 to your computer and use it in GitHub Desktop.
Teach mootools to clone events of children too.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Native.implement([Element, Window, Document], { | |
cloneEventsDeep: function(from, type){ | |
if (this.getChildren().length > 0) { | |
this.getChildren().each(function(item, index) { | |
item.cloneEventsDeep(from.getChildren()[index], type); | |
}); | |
this.cloneEvents(from, type); | |
} else { | |
this.cloneEvents(from, type); | |
} | |
return this; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment