prevent stacking alerts: no more undo/redo

This commit is contained in:
Fred Sauer committed 2026-03-22 10:40:31 -07:00
1 parent 21cf286d4c
commit cf60055c77
1 file changed
+9 -2
+9 -2
View File
@@ -22,6 +22,7 @@ export class ProjectWindows {
undofiles: string[];
redofiles: string[];
titlePrefix: string;
alerting: boolean;
constructor(containerdiv: HTMLElement, project: CodeProject) {
this.containerdiv = containerdiv;
@@ -171,7 +172,7 @@ export class ProjectWindows {
this.redofiles.push(fileid);
this.refresh(false);
} else {
bootbox.alert("No more steps to undo.");
this.showAlert("No more steps to undo.");
}
}
@@ -183,10 +184,16 @@ export class ProjectWindows {
this.undofiles.push(fileid);
this.refresh(false);
} else {
bootbox.alert("No more steps to redo.");
this.showAlert("No more steps to redo.");
}
}
showAlert(msg: string) {
if (this.alerting) return;
this.alerting = true;
bootbox.alert(msg, () => { this.alerting = false; });
}
updateAllOpenWindows(store) {
for (var fileid in this.id2window) {
var wnd = this.id2window[fileid];