mirror of
https://git.proxmox.com/git/proxmox-widget-toolkit
synced 2025-05-04 11:09:20 +00:00
FileBrowser: allow downloading root folder and simplify code
Signed-off-by: Stefan Reiter <s.reiter@proxmox.com>
This commit is contained in:
parent
68b29adede
commit
2a778ef98c
@ -98,23 +98,7 @@ Ext.define("Proxmox.window.FileBrowser", {
|
|||||||
if (!selection || selection.length < 1) return;
|
if (!selection || selection.length < 1) return;
|
||||||
|
|
||||||
let data = selection[0].data;
|
let data = selection[0].data;
|
||||||
|
let canDownload = view.downloadUrl && ['h', 'f', 'd'].indexOf(data.type) !== -1;
|
||||||
let canDownload = false;
|
|
||||||
if (view.downloadUrl) {
|
|
||||||
switch (data.type) {
|
|
||||||
case 'h':
|
|
||||||
case 'f':
|
|
||||||
canDownload = true;
|
|
||||||
break;
|
|
||||||
case 'd':
|
|
||||||
if (data.depth > 1) {
|
|
||||||
canDownload = true;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
me.lookup('downloadBtn').setDisabled(!canDownload);
|
me.lookup('downloadBtn').setDisabled(!canDownload);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user