Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit f265e74

Browse files
committed
Fix according to latest comment
1 parent 151f3c1 commit f265e74

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

src/project/ProjectManager.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -684,18 +684,18 @@ define(function (require, exports, module) {
684684
};
685685
var createCustomHandler = function(originalHandler) {
686686
return function (event) {
687-
var $node = $(event.target).parent("li");
687+
var $node = $(event.target).parent("li"),
688+
methodName;
688689
if (event.ctrlKey || event.metaKey) {
689690
if (event.altKey) {
690691
// collapse subtree
691692
// note: expanding using open_all is a bad idea due to poor performance
692-
if ($node.is(".jstree-open")) {
693-
_projectTree.jstree("close_all", $node);
694-
return;
695-
}
693+
methodName = $node.is(".jstree-open") ? "close_all" : "open_node";
694+
_projectTree.jstree(methodName, $node);
695+
return;
696696
} else {
697697
// toggle siblings
698-
var methodName = $node.is(".jstree-open") ? "close_node" : "open_node";
698+
methodName = $node.is(".jstree-open") ? "close_node" : "open_node";
699699
$node.parent().children("li").each(function () {
700700
_projectTree.jstree(methodName, $(this));
701701
});

0 commit comments

Comments
 (0)