js/FilterNode.js
function() {
        if (this.parent) {
            var newListItem = document.createElement(CHILD_TAG);

            if (this.notesEl) {
                newListItem.appendChild(this.notesEl);
            }

            if (!this.keep) {
                var el = this.templates.get('removeButton');
                el.addEventListener('click', this.remove.bind(this));
                newListItem.appendChild(el);
            }

            newListItem.appendChild(this.el);

            this.parent.el.querySelector(CHILDREN_TAG).appendChild(newListItem);
        }
    }
function() {
        if (this.parent) {
            var newListItem = document.createElement(CHILD_TAG);

            if (this.notesEl) {
                newListItem.appendChild(this.notesEl);
            }

            if (!this.keep) {
                var el = this.templates.get('removeButton');
                el.addEventListener('click', this.remove.bind(this));
                newListItem.appendChild(el);
            }

            newListItem.appendChild(this.el);

            this.parent.el.querySelector(CHILDREN_TAG).appendChild(newListItem);
        }
    }
function ( ) { if ( this . parent ) { var newListItem = document . createElement ( CHILD_TAG ) ; if ( this . notesEl ) { newListItem . appendChild ( this . notesEl ) ; } if ( ! this . keep ) { var el = this . templates . get ( 'removeButton' ) ; el . addEventListener ( 'click' , this . remove . bind ( this ) ) ; newListItem . appendChild ( el ) ; } newListItem . appendChild ( this . el ) ; this . parent . el . querySelector ( CHILDREN_TAG ) . appendChild ( newListItem ) ; } }
Insert each subtree into its parent node along with a "delete" button.

NOTE: The root tree (which has no parent) must be inserted into the DOM by the instantiating code (without a delete button).
@memberOf FilterNode#
Insert each subtree into its parent node along with a delete button .