diff options
author | Maxim Devaev <[email protected]> | 2023-03-20 17:40:38 +0200 |
---|---|---|
committer | Maxim Devaev <[email protected]> | 2023-03-20 17:40:38 +0200 |
commit | 426ed5da12073aefa72768226dbdf3a57cc0cfc0 (patch) | |
tree | 977671c231dbdd94b460abf814301f197b33f9e4 /web | |
parent | c4a2363451611bcb7447e82bba284bfb71943dc2 (diff) |
fixed blocking the msd parts selector
Diffstat (limited to 'web')
-rw-r--r-- | web/share/js/kvm/msd.js | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/web/share/js/kvm/msd.js b/web/share/js/kvm/msd.js index ae8867be..2f78655e 100644 --- a/web/share/js/kvm/msd.js +++ b/web/share/js/kvm/msd.js @@ -270,8 +270,12 @@ export function Msd() { tools.el.setEnabled($("msd-new-file"), (online && !s.drive.connected && !__http && !s.busy)); tools.el.setEnabled($("msd-new-url"), (online && !s.drive.connected && !__http && !s.busy)); - tools.el.setEnabled($("msd-new-part"), (online && !s.drive.connected && !__http && !s.busy)); - __applyStatePartSelector(); + tools.el.setEnabled($("msd-new-part-selector"), (online && !s.drive.connected && !__http && !s.busy)); + if (online && !s.storage.uploading && !s.storage.downloading) { + let parts = Object.keys(s.storage.parts).sort().filter(name => (name === "" || s.storage.parts[name].writable)); + tools.selector.setValues($("msd-new-part-selector"), parts, "\u2500 Internal \u2500"); + tools.hidden.setVisible($("msd-new-part"), (parts.length > 1)); + } tools.hidden.setVisible($("msd-uploading-sub"), (online && s.storage.uploading)); $("msd-uploading-name").innerHTML = ((online && s.storage.uploading) ? s.storage.uploading.name : ""); @@ -357,16 +361,5 @@ export function Msd() { return info; }; - var __applyStatePartSelector = function() { - let s = __state; - if (!(s && s.online) || s.storage.uploading || s.storage.downloading) { - return; - } - let el = $("msd-new-part-selector"); - let parts = Object.keys(s.storage.parts).sort().filter(name => (name === "" || s.storage.parts[name].writable)); - tools.selector.setValues(el, parts, "\u2500 Internal \u2500"); - tools.hidden.setVisible($("msd-new-part"), (parts.length > 1)); - }; - __init__(); } |