Posted By

tstachl on 10/07/10


Tagged

events clone mootools children cloneEvents


Versions (?)

Mootools cloneEventsDeep clones events from children too


 / Published in: JavaScript
 

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

  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  

You need to login to post a comment.