Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
af235c86
Commit
af235c86
authored
Feb 01, 2018
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add isExpanded && updateNode function
parent
8746cf79
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
0 deletions
+19
-0
TreeView.js
remix-debugger/src/ui/TreeView.js
+19
-0
No files found.
remix-debugger/src/ui/TreeView.js
View file @
af235c86
...
@@ -105,6 +105,14 @@ class TreeView {
...
@@ -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 {
...
@@ -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>`
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment