]> _ Git - fluidbook-html5.git/commitdiff
wip #3638 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 May 2020 16:08:36 +0000 (18:08 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 12 May 2020 16:08:36 +0000 (18:08 +0200)
js/libs/fluidbook/fluidbook.splash.js
js/libs/scorm/scorm.js

index 8a01a120a3cf9789300ead8b24a664ac3391426e..264f53961d08f421bdbd9b8b6de2b67964b610f6 100644 (file)
@@ -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 {
index e9ad742c3afbbcbfbbcff1b12a2aadc81cd0820d..8df6674cb22db5568161bf34dc2b4e335531cdd3 100644 (file)
@@ -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);
     }