From 9f8b3c4728e1d4023d6db8137318ad37cea49c06 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 23 Nov 2018 18:28:11 +0100 Subject: [PATCH] fix #2370 @0:20 --- js/libs/fluidbook/fluidbook.3dflip.js | 16 ++++++++++------ js/libs/scorm/scorm.js | 15 +++++++++------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.3dflip.js b/js/libs/fluidbook/fluidbook.3dflip.js index 859e58cd..3642ad8c 100644 --- a/js/libs/fluidbook/fluidbook.3dflip.js +++ b/js/libs/fluidbook/fluidbook.3dflip.js @@ -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; diff --git a/js/libs/scorm/scorm.js b/js/libs/scorm/scorm.js index e298400d..d915925e 100644 --- a/js/libs/scorm/scorm.js +++ b/js/libs/scorm/scorm.js @@ -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) { -- 2.39.5