Save content state on visibility change event

pull/107/head
Oliver Tacke 2021-10-18 12:51:34 +02:00
parent aaf26d584b
commit 218125f7cd
1 changed files with 2 additions and 2 deletions

View File

@ -2865,11 +2865,11 @@ H5P.createTitle = function (rawTitle, maxLength) {
// iPad does not support beforeunload, therefore using unload
H5P.$window.one('beforeunload unload', function () {
// Only want to do this once
H5P.$window.off('pagehide beforeunload unload');
H5P.$window.off('pagehide visibilitychange beforeunload unload');
storeCurrentState();
});
// pagehide is used on iPad when tabs are switched
H5P.$window.on('pagehide', storeCurrentState);
H5P.$window.on('pagehide visibilitychange', storeCurrentState);
}
});