Skip to content

Commit

Permalink
can open trees where parent_id prop name is parentId
Browse files Browse the repository at this point in the history
  • Loading branch information
socketteer committed Dec 24, 2021
1 parent 4f45397 commit 0abb68a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 3 additions & 3 deletions controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -1013,7 +1013,7 @@ def toggle_editable(self):

@metadata(name="Write textbox")
def write_textbox_changes(self):
print('writing')
#print('writing')
if self.state.preferences['editable'] and self.display.mode == 'Read' and self.state.selected_node:
new_text = self.display.textbox.get("1.0", "end-1c")
ancestry = self.state.ancestry(self.state.selected_node)
Expand Down Expand Up @@ -2256,8 +2256,8 @@ def module_textbox_has_focus(self):

@metadata(name="Save Edits")
def save_edits(self, **kwargs):
print('save edits')
print(kwargs)
#print('save edits')
#print(kwargs)
if not self.state.selected_node_id:
return

Expand Down
3 changes: 3 additions & 0 deletions util/util_tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,9 @@ def fix_tree(tree):
tree = tree['root']
if 'children' not in tree:
tree['children'] = []
if 'parentId' in tree:
tree['parent_id'] = tree['parentId']
del tree['parentId']
else:
for child in tree['children']:
fix_tree(child)

0 comments on commit 0abb68a

Please sign in to comment.