From 3fbee3336900ca57a8b9594c99a8bae7597ec4a3 Mon Sep 17 00:00:00 2001 From: Pablo Vazquez Date: Tue, 29 Nov 2016 14:39:47 +0100 Subject: [PATCH] Open jstree folders on load, and set parent as selected as well So when we open a node inside a folder, it highlights itself and parent folder --- pillar/web/utils/jstree.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pillar/web/utils/jstree.py b/pillar/web/utils/jstree.py index 9c59700d..b1f4ef70 100644 --- a/pillar/web/utils/jstree.py +++ b/pillar/web/utils/jstree.py @@ -87,7 +87,7 @@ def jstree_build_from_node(node): api = system_util.pillar_api() # Parse the node and mark it as selected child_node = jstree_parse_node(node) - child_node['state'] = dict(selected=True) + child_node['state'] = dict(selected=True, opened=True) # Splice the specified child node between the other project children. def select_node(x): @@ -123,7 +123,7 @@ def jstree_build_from_node(node): # Overwrite children_node with the current parent child_node = parent_parent # Set the node to open so that jstree actually displays the nodes - child_node['state'] = dict(opened=True) + child_node['state'] = dict(selected=True, opened=True) # Push in the computed children into the parent child_node['children'] = parent_children # If we have a parent