traverseChildren(callback) {
    // Find the index and apply callback
    let index;
    if (this.parentNode) {
      index = this.parentNode.childNodes.filter(node => !node.meta.skipAddToDom).indexOf(this);
    } else {
      index = 0;
    }
    this.index = index;
    callback(this);
    // Find the children
    if (this.childNodes.length) {
      this.childNodes.forEach((childNode) => {
        this.traverseChildren.call(childNode, callback);
      });
    }
  }
/**
   * Traverse the children and execute callback
   */
Traverse the children and execute callback
Traverse the children and execute callback
traverseChildren(callback) {
    let index;
    if (this.parentNode) {
      index = this.parentNode.childNodes.filter(node => !node.meta.skipAddToDom).indexOf(this);
    } else {
      index = 0;
    }
    this.index = index;
    callback(this);
    if (this.childNodes.length) {
      this.childNodes.forEach((childNode) => {
        this.traverseChildren.call(childNode, callback);
      });
    }
  }
traverseChildren ( callback ) { let index ; if ( this . parentNode ) { index = this . parentNode . childNodes . filter ( node => ! node . meta . skipAddToDom ) . indexOf ( this ) ; } else { index = 0 ; } this . index = index ; callback ( this ) ; if ( this . childNodes . length ) { this . childNodes . forEach ( ( childNode ) => { this . traverseChildren . call ( childNode , callback ) ; } ) ; } }
Traverse the children and execute callback
Traverse the children and execute callback
// Find the index and apply callback // Find the children