Mootools cloneEventsDeep clones events from children too


/ Published in: JavaScript
Save to your folder(s)

Put this snippet into the mootools core file right next to the cloneEvents function.


Copy this code and paste it in your HTML
  1. cloneEventsDeep: function(from, type){
  2. if (this.getChildren().length > 0) {
  3. this.getChildren().each(function(item, index) {
  4. item.cloneEventsDeep(from.getChildren()[index], type);
  5. });
  6. this.cloneEvents(from, type);
  7. } else {
  8. this.cloneEvents(from, type);
  9. }
  10. return this;
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.