diff options
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__(); } |