add isExpanded && updateNode function

pull/1/head
yann300 7 years ago
parent 8746cf7912
commit af235c8684
  1. 19
      remix-debugger/src/ui/TreeView.js

@ -105,6 +105,14 @@ class TreeView {
return li
}
isExpanded (path) {
var current = this.nodeAt(path)
if (current) {
return current.style.display !== 'none'
}
return false
}
expand (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'
@ -117,6 +125,17 @@ class TreeView {
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) {
return yo`<label>${key}: ${data.self}</label>`
}

Loading…
Cancel
Save