in desktop/src/@batch-flask/ui/file/file-explorer/file-tree-view/file-tree-view.component.ts [139:165]
public showContextMenu(event: Event, treeRow?: TreeRow) {
event.stopPropagation();
const items = [];
if (treeRow) {
items.push(new ContextMenuItem("Download", () => this.download(treeRow)));
}
if (!treeRow || treeRow.isDirectory) {
items.push(new ContextMenuItem("Refresh", () => this.refresh(treeRow && treeRow.path)));
if (this.canDropExternalFiles) {
items.push(new ContextMenuItem("New folder", () => this.newVirtualFolder(treeRow)));
}
}
if (treeRow && this.fileNavigator.canDeleteFile) {
items.push(new ContextMenuItem("Delete", () => this.deleteFiles.emit({
path: treeRow.path,
isDirectory: treeRow.isDirectory,
navigator: this.fileNavigator,
})));
}
if (items.length > 0) {
this.contextMenuService.openMenu(new ContextMenu(items));
}
}