show current game when warning from full-page menu - fixes #454

This commit is contained in:
Thibault Duplessis 2015-05-02 16:21:36 +02:00
parent 02613fac38
commit d076375c8c

View file

@ -19,6 +19,7 @@ module.exports = function(ctrl) {
if (game.isPlayerPlaying(d)) {
window.addEventListener('beforeunload', function(e) {
if (!lichess.hasToReload && !ctrl.data.blind && game.playable(ctrl.data) && ctrl.data.clock) {
document.body.classList.remove('fpmenu');
ctrl.socket.send('bye');
var msg = 'There is a game in progress!';
(e || window.event).returnValue = msg;