mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
Fix bug where the alert dialog would not close (#32)
Micromodal maintains a reference to the current open dialog in this.modal. If one dialog is open while opening another, Micromodal can get confused and maintain a reference to the wrong one. One of the problems is that the close action is not instantaneous, so even closing one dialog and opening another immediately after can cause the problem. This change adds a small delay before opening the alert dialog to work around the problem.
This commit is contained in:
parent
a200d6de83
commit
ccad317f63
@ -233,6 +233,7 @@ export function doSave() {
|
|||||||
var name = document.querySelector('#save_name').value;
|
var name = document.querySelector('#save_name').value;
|
||||||
saveLocalStorage(_currentDrive, name);
|
saveLocalStorage(_currentDrive, name);
|
||||||
MicroModal.close('save-modal');
|
MicroModal.close('save-modal');
|
||||||
|
window.setTimeout(() => openAlert('Saved'), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function doDelete(name) {
|
export function doDelete(name) {
|
||||||
@ -508,8 +509,6 @@ function saveLocalStorage(drive, name) {
|
|||||||
|
|
||||||
window.localStorage.diskIndex = JSON.stringify(diskIndex);
|
window.localStorage.diskIndex = JSON.stringify(diskIndex);
|
||||||
|
|
||||||
openAlert('Saved');
|
|
||||||
|
|
||||||
driveLights.label(drive, name);
|
driveLights.label(drive, name);
|
||||||
driveLights.dirty(drive, false);
|
driveLights.dirty(drive, false);
|
||||||
updateLocalStorage();
|
updateLocalStorage();
|
||||||
|
Loading…
Reference in New Issue
Block a user