]> _ Git - fluidbook-html5.git/commitdiff
fix #2370 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Nov 2018 17:28:11 +0000 (18:28 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 23 Nov 2018 17:28:11 +0000 (18:28 +0100)
js/libs/fluidbook/fluidbook.3dflip.js
js/libs/scorm/scorm.js

index 859e58cd6e74aa5ec4da622b9f34dede9e8ce11d..3642ad8c9f17256165f655c5869be68d408cb525 100644 (file)
@@ -62,8 +62,8 @@ Fluidbook3DFlip.prototype = {
     init3D: function (performanceMode) {
         try {
             this.dispose3D();
-        }catch (e) {
-            
+        } catch (e) {
+
         }
 
         if (performanceMode === 'disable') {
@@ -209,14 +209,18 @@ Fluidbook3DFlip.prototype = {
         this.bendForceMultiplicator = 1;
 
         var ratio = this.fluidbook.datas.width / this.fluidbook.datas.height;
-        if (ratio > 0.85) {
-            this.bendAngle = 30;
-            this.bendOffset = 0.5;
-            this.bendForceMultiplicator = 1.1;
+        if (ratio > 1.2) {
+            this.bendAngle = 5;
+            this.bendOffset = 0.4;
+            this.bendForceMultiplicator = 1.3;
         } else if (ratio >= 1) {
             this.bendAngle = 10;
             this.bendOffset = 0.4;
             this.bendForceMultiplicator = 1.2;
+        } else if (ratio > 0.85) {
+            this.bendAngle = 30;
+            this.bendOffset = 0.5;
+            this.bendForceMultiplicator = 1.1;
         }
         this.bend = new Bend(0, this.bendOffset, this.bendAngle * 0.0174533);
         this.bend.constraint = -1;
index e298400d740dc477540ab3e1b7e6cc9df4f15a11..d915925eb2f04079e66950c5b8994b00d2efe9fa 100644 (file)
@@ -36,8 +36,8 @@ function initScorm() {
     SCORM_INITED = true;
     try {
         pipwerks.SCORM.init();
-    }catch (e) {
-        
+    } catch (e) {
+
     }
     setScormValue('exit', 'suspend');
     startScormTimer();
@@ -70,7 +70,6 @@ function initScormEvents() {
     }
     SCORM_EVENTS_INITED = true;
 
-    console.log('init scorm events');
     $(window).on('unload', function () {
         finishScorm();
     });
@@ -101,7 +100,9 @@ function initScormEvents() {
 
 
     $(fluidbook).on('fluidbook.page.navigation', function (e, page) {
-        scormSaveCurrentPosition(page);
+        fluidbook.executeWhenNetwork(function () {
+            scormSaveCurrentPosition(page);
+        });
     });
 
     $(fluidbook).on('fluidbook.maxpage.set', function (e, page) {
@@ -111,8 +112,10 @@ function initScormEvents() {
 
     // Commit data once a minute
     setInterval(function () {
-        pipwerks.SCORM.save();
-    }, 2000);
+        fluidbook.executeWhenNetwork(function () {
+            pipwerks.SCORM.save();
+        });
+    }, 5000);
 }
 
 function scormSaveCurrentPosition(page, maxPage) {