From: Vincent Vanwaelscappel Date: Tue, 24 Sep 2024 06:00:26 +0000 (+0200) Subject: wip #7090 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f5d1b54deb3f515b4bcad2feea661540b1c9cd0c;p=fluidbook-toolbox.git wip #7090 @0.5 --- diff --git a/resources/scorm/scorm.js b/resources/scorm/scorm.js index 296820268..ae46b32b9 100644 --- a/resources/scorm/scorm.js +++ b/resources/scorm/scorm.js @@ -48,8 +48,8 @@ CubeSCORM.prototype = { } this.SCORM_INITED = true; - if(disable===true){ - this.SCORM_OK=false; + if (disable === true) { + this.SCORM_OK = false; return false; } try { @@ -101,8 +101,14 @@ CubeSCORM.prototype = { let $this = this; this.SCORM_EVENTS_INITED = true; - $(window).on('unload', function () { - $this.finishScorm(); + window.addEventListener('pageshow', (event) => { + if (event.persisted) { + location.reload(); + } + }); + + window.addEventListener('pagehide', (event) => { + finishScorm(); }); setInterval(function () {