fix puzzle background load

pull/2850/head
Thibault Duplessis 2017-03-26 03:23:34 +02:00
parent e4f1ffa63f
commit 56e047730f
1 changed files with 9 additions and 0 deletions

View File

@ -439,6 +439,15 @@ module.exports = function(opts, i18n) {
}
});
// If the page loads while being hidden (like when changing settings),
// chessground is not displayed, and the first move is not fully applied.
// Make sure chessground is fully shown when the page goes back to being visible.
document.addEventListener('visibilitychange', function() {
lichess.requestIdleCallback(function() {
jump(initialPath);
});
});
return {
vm: vm,
getData: function() {