1
0
This commit is contained in:
Scott E. Graves
2017-03-22 18:37:25 -05:00
parent 0f78d38ccb
commit 156ada3e73

View File

@@ -174,26 +174,32 @@
AppActions.startApp();
setMainWindow('app_window');
const mountButton = document.getElementById('ID_MountButton');
const mountSelect = document.getElementById('ID_MountDrives');
const mountHandler = ()=> {
mountButton.onclick = null;
mountButton.disabled = true;
mountSelect.disabled = true;
if (mountButton.innerText === "Mount") {
AppActions.mountDrive(document.getElementById('ID_MountDrives').value, (success, reason) => {
AppActions.mountDrive(mountSelect.value, (success, reason) => {
if (success) {
mountButton.innerText = "Unmount";
} else {
displayErrorPopup('Mount Failed', reason);
}
mountButton.onclick = mountHandler;
mountButton.disabled = false;
});
} else {
AppActions.unmountDrive((success, reason) => {
if (success) {
mountButton.innerText = "Mount";
mountSelect.disabled = false;
} else {
displayErrorPopup('Unmount Failed', reason);
}
mountButton.onclick = mountHandler;
mountButton.disabled = false;
});
}
};