🔧 Prompt User to Save Before Page Unload

This commit is contained in:
Erin 2020-07-07 10:35:20 -04:00
parent dc40e7c502
commit f4022c6cd5

View file

@ -1328,6 +1328,10 @@ export default mixins(
document.addEventListener('keydown', this.keyDown); document.addEventListener('keydown', this.keyDown);
document.addEventListener('keyup', this.keyUp); document.addEventListener('keyup', this.keyUp);
window.onbeforeunload = this.confirmSave;
},
async confirmSave(e: Event) {
window.confirm();
}, },
__addConnection (connection: [IConnection, IConnection], addVisualConnection = false) { __addConnection (connection: [IConnection, IConnection], addVisualConnection = false) {
if (addVisualConnection === true) { if (addVisualConnection === true) {