Simplify jstree js code