Added warning before leaving the page

This commit is contained in:
Thomas FORGIONE 2015-06-22 14:08:11 +02:00
parent 0833727d96
commit 0ba03cdece
1 changed files with 9 additions and 0 deletions

View File

@ -42,6 +42,15 @@ var loader;
var coins = [];
var previousTime;
window.onbeforeunload = function() {
if (initMainScene !== initPeach && initMainScene !== initSponza && Coin.total !== 9) {
return 'Warning : you are going to leave the page and abort the current test !';
}
}
init();