Fix indent in renderTree, remove first indents
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
243c5df043
commit
5d924744de
|
@ -5,12 +5,17 @@ import copy from 'copy-text-to-clipboard'
|
||||||
function renderTree(tree)
|
function renderTree(tree)
|
||||||
{
|
{
|
||||||
if (!tree) return []
|
if (!tree) return []
|
||||||
|
|
||||||
|
let recRenderTree = (tree, indent) => {
|
||||||
return _.flatMapDeep(tree, (item) => [
|
return _.flatMapDeep(tree, (item) => [
|
||||||
_.repeat(" ", item.indented) + item.text,
|
_.repeat(" ", item.indented-indent) + item.text,
|
||||||
renderTree(item.children),
|
recRenderTree(item.children, indent),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return recRenderTree(tree, tree[0].indented)
|
||||||
|
}
|
||||||
|
|
||||||
function connectContextMenu(editor) {
|
function connectContextMenu(editor) {
|
||||||
$.contextMenu({
|
$.contextMenu({
|
||||||
selector: '.marker',
|
selector: '.marker',
|
||||||
|
|
Loading…
Reference in New Issue
Block a user