|
|
@ -105,6 +105,14 @@ class TreeView { |
|
|
|
return li |
|
|
|
return li |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
isExpanded (path) { |
|
|
|
|
|
|
|
var current = this.nodeAt(path) |
|
|
|
|
|
|
|
if (current) { |
|
|
|
|
|
|
|
return current.style.display !== 'none' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
expand (path) { |
|
|
|
expand (path) { |
|
|
|
if (this.labels[path]) { |
|
|
|
if (this.labels[path]) { |
|
|
|
this.carets[path].className = this.carets[path].className === 'fa fa-caret-right' ? 'fa fa-caret-down' : 'fa fa-caret-right' |
|
|
|
this.carets[path].className = this.carets[path].className === 'fa fa-caret-right' ? 'fa fa-caret-down' : 'fa fa-caret-right' |
|
|
@ -117,6 +125,17 @@ class TreeView { |
|
|
|
return this.nodes[path] |
|
|
|
return this.nodes[path] |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateNode (path, newNode) { |
|
|
|
|
|
|
|
var current = this.nodeAt(path) |
|
|
|
|
|
|
|
if (current) { |
|
|
|
|
|
|
|
var parent = current.parentNode |
|
|
|
|
|
|
|
if (parent) { |
|
|
|
|
|
|
|
parent.replaceChild(newNode, current) |
|
|
|
|
|
|
|
this.nodes[path] = newNode |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
formatSelfDefault (key, data) { |
|
|
|
formatSelfDefault (key, data) { |
|
|
|
return yo`<label>${key}: ${data.self}</label>` |
|
|
|
return yo`<label>${key}: ${data.self}</label>` |
|
|
|
} |
|
|
|
} |
|
|
|