Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/project/ProjectManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,24 @@ define(function (require, exports, module) {

_savePreferences();
}
)
.bind(
"mousedown.jstree",
function (event) {
// select tree node on right-click
if (event.which === 3) {
var treenode = $(event.target).closest("li");
if (treenode) {
var saveSuppressToggleOpen = suppressToggleOpen;

// don't toggle open folders (just select)
suppressToggleOpen = true;
_projectTree.jstree("deselect_all");
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future when the tree supports multiple selection we don't want to deselect all here in order to allow the user to shift-select multiple files and execute a command from the context menu. Maybe leave a comment about this here for future reference?

_projectTree.jstree("select_node", treenode, false);
suppressToggleOpen = saveSuppressToggleOpen;
}
}
}
);

// jstree has a default event handler for dblclick that attempts to clear the
Expand Down