diff --git a/elements/tree-view.html b/elements/tree-view.html index 48e5bed..51e8a65 100644 --- a/elements/tree-view.html +++ b/elements/tree-view.html @@ -14,6 +14,11 @@ @@ -81,17 +117,21 @@ ready() { super.ready(); - this.$.tree.addEventListener('click', this.findElement.bind(this)) + this.$.tree.addEventListener('click', this.findElement.bind(this)); } recomputeTree(parent, active) { this.$.tree.innerHTML = ''; + let ul = document.createElement('ul'); + ul.classList.add('tree'); + this.$.tree.appendChild(ul); + // Since we can't add a pojo to each button, generate a new index for // each button in the this.items array of useful data. + this._index = 0; - this.items = this.getChildren(parent, this.$.tree); + this.items = this.getChildren(parent, ul); this.highlight(active); - this.$.tree return this.items; } @@ -109,40 +149,44 @@ return aButton; } - getChildren(parent, div) { - // At every new parent, we create a new