Merged in feature/MAPG-72-revision-of-the-confirmation (pull request #60)

MAPG-72 prevent to show 'beforeonload' confirmation panel if we already have the real position (guess is evaluated)
This commit is contained in:
Bence Pőcze 2020-05-30 16:15:40 +00:00
commit 5bc2d73ceb

View File

@ -197,7 +197,7 @@
scoreBar.style.backgroundColor = scoreBarProperties.backgroundColor; scoreBar.style.backgroundColor = scoreBarProperties.backgroundColor;
scoreBar.style.width = scoreBarProperties.width; scoreBar.style.width = scoreBarProperties.width;
if (Core.rounds.length == Core.NUMBER_OF_ROUNDS) { if (Core.rounds.length === Core.NUMBER_OF_ROUNDS) {
document.getElementById('continueButton').style.display = 'none'; document.getElementById('continueButton').style.display = 'none';
document.getElementById('showSummaryButton').style.display = 'block'; document.getElementById('showSummaryButton').style.display = 'block';
} }
@ -444,6 +444,10 @@
} }
window.onbeforeunload = function (e) { window.onbeforeunload = function (e) {
if (Core.rounds[Core.rounds.length - 1].position) {
return;
}
e.preventDefault(); e.preventDefault();
e.returnValue = ''; e.returnValue = '';
}; };