Merged in develop (pull request #70)
MAPG-90 disable unload prevention and unify onbeforeunload script (loading animation)
This commit is contained in:
commit
02c258d1c0
@ -231,6 +231,7 @@ div.mapItem>div.inner>div.info>p:nth-child(2) {
|
|||||||
margin-top: -32px;
|
margin-top: -32px;
|
||||||
margin-left: -32px;
|
margin-left: -32px;
|
||||||
z-index: 5;
|
z-index: 5;
|
||||||
|
visibility: hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
#roundInfo {
|
#roundInfo {
|
||||||
|
@ -446,15 +446,4 @@
|
|||||||
document.getElementById('startNewGameButton').onclick = function () {
|
document.getElementById('startNewGameButton').onclick = function () {
|
||||||
Core.resetGame();
|
Core.resetGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
// showing the loading animation is not possible, because we don't know if user cancelled the leave
|
|
||||||
|
|
||||||
window.onbeforeunload = function (e) {
|
|
||||||
if (Core.rounds[Core.rounds.length - 1].position) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
e.preventDefault();
|
|
||||||
e.returnValue = '';
|
|
||||||
};
|
|
||||||
})();
|
})();
|
||||||
|
@ -44,11 +44,4 @@
|
|||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
|
||||||
document.getElementById('loading').style.visibility = 'hidden';
|
|
||||||
|
|
||||||
window.addEventListener('beforeunload', function (e) {
|
|
||||||
document.getElementById('loading').style.visibility = 'visible';
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<?php require 'templates/main_footer.php'; ?>
|
<?php require 'templates/main_footer.php'; ?>
|
@ -1,2 +1,7 @@
|
|||||||
|
<script>
|
||||||
|
window.addEventListener('beforeunload', function (e) {
|
||||||
|
document.getElementById('loading').style.visibility = 'visible';
|
||||||
|
});
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue
Block a user