From 3eb22f4bee925a35f87be8a9fa984bf1e8749152 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Tue, 12 May 2020 18:08:36 +0200 Subject: [PATCH] wip #3638 @2 --- js/libs/fluidbook/fluidbook.splash.js | 7 ++++++- js/libs/scorm/scorm.js | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/js/libs/fluidbook/fluidbook.splash.js b/js/libs/fluidbook/fluidbook.splash.js index 8a01a120..264f5396 100644 --- a/js/libs/fluidbook/fluidbook.splash.js +++ b/js/libs/fluidbook/fluidbook.splash.js @@ -1,5 +1,6 @@ function FluidbookSplash(fluidbook) { this.fluidbook = fluidbook; + this.hideSplashTimeout = 1; this.init(); } @@ -35,9 +36,13 @@ FluidbookSplash.prototype = { setTimeout(function () { this.fluidbook.pagetransitions.flip3d.performancesTest(function () { $this.fluidbook.networkControl.resume(); + var timeout = $this.hideSplashTimeout; + if (window.SCORM !== undefined && window.SCORM===true) { + timeout += 5; + } setTimeout(function () { $this.hideIfPossible(); - }, 1000); + }, timeout * 1000); }) }, 500); } else { diff --git a/js/libs/scorm/scorm.js b/js/libs/scorm/scorm.js index e9ad742c..8df6674c 100644 --- a/js/libs/scorm/scorm.js +++ b/js/libs/scorm/scorm.js @@ -83,10 +83,12 @@ function initScormEvents() { SCORM_LOCATION_INITED = true; var currentLocation = getScormValue('location'); try { + var changePage = false; if (currentLocation.indexOf('page_') === 0) { var e = currentPage.split('_'); if (e.length === 2 && e[0] === 'page') { fluidbook.setCurrentPage(e[1]); + changePage = true; } } else if (currentLocation.indexOf('{') === 0) { var location = JSON.parse(currentLocation); @@ -95,8 +97,13 @@ function initScormEvents() { } if (location.page) { fluidbook.setCurrentPage(location.page); + changePage = true; } } + + if (changePage) { + fluidbook.splash.hideSplashTimeout = 6; + } } catch (err) { console.log(err); } -- 2.39.5