Skip to content

Commit

Permalink
Do not select root node on JSTree refresh
Browse files Browse the repository at this point in the history
Addresses: #372

Signed-off-by: Steven Esser <sesser@nexb.com>
  • Loading branch information
steven-esser committed Jul 11, 2019
1 parent 1893849 commit 9c97219
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions assets/app/js/controllers/conclusionDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class ConclusionDialog extends Controller {
.then(() => this.getHandler('delete')(conclusion));
}
});
$('.jstree').jstree(true).refresh(true);
}

// Populate modal input fields with suggestions from ScanCode results
Expand Down
4 changes: 2 additions & 2 deletions assets/app/js/controllers/jsTree.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ class JsTree extends Controller {
data.instance.set_icon(data.node, 'fa fa-folder fa_custom_package');
}
})
// Select the root node when the tree is refreshed
.on('refresh.jstree', () => {
// Select the root node when the tree is loaded
.on('loaded.jstree', () => {
const rootNode = this.jsTree().jstree('get_node', '#').children;
this.jsTree().jstree('select_node', rootNode);
})
Expand Down

0 comments on commit 9c97219

Please sign in to comment.