Files
digiproof/js/confirm.js
git@daemon.de 10e5d547f3 Changed the build process it generates a devel and a prod version
of the source, added some screenshots and a sample printout, couple
bugfixes.
2013-09-14 13:14:06 +02:00

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";
}
}