Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Teach mootools to clone events of children too.
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
You can’t perform that action at this time.