mirror of
https://github.com/sehugg/8bitworkshop.git
synced 2026-10-24 08:02:27 +00:00
prevent stacking alerts: no more undo/redo
This commit is contained in:
1 parent
21cf286d4c
commit
cf60055c77
1 file changed
+9
-2
+9
-2
@@ -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];
|
||||
|
||||
Reference in new issue
Block a user