mirror of
https://codeberg.org/scip/digiproof.git
synced 2025-12-16 20:21:00 +01:00
22 lines
458 B
JavaScript
22 lines
458 B
JavaScript
|
|
function confirminit() {
|
|
window.onbeforeunload = function(e) {
|
|
if(window.confirmExit) return confirmExit();
|
|
};
|
|
}
|
|
|
|
var hadConfirmExit = false;
|
|
function checkUnsavedChanges() {
|
|
if(App.store && App.store.isDirty && window.hadConfirmExit === false) {
|
|
if(confirm("unsafed changes"))
|
|
saveChanges();
|
|
}
|
|
}
|
|
|
|
function confirmExit() {
|
|
hadConfirmExit = true;
|
|
if(App.store && App.store.isDirty) {
|
|
return "ok";
|
|
}
|
|
}
|