]> _ Git - fluidbook-html5.git/commitdiff
wip #2358 @2
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 20 Nov 2018 19:02:02 +0000 (20:02 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 20 Nov 2018 19:02:02 +0000 (20:02 +0100)
js/libs/fluidbook/fluidbook.resize.js
js/libs/fluidbook/fluidbook.support.js
js/libs/scorm/scorm.js

index 96ec40f74fb45b00c9ab89ec2409169e81fe433b..d2a3aa3b8aee9bed1b12cb7a6f5b841389f08c57 100644 (file)
@@ -69,7 +69,27 @@ FluidbookResize.prototype = {
                 setTimeout(resize, 3000);
             });
         }
+
+        if (this.fluidbook.support.IE > 9) {
+           this.watchForResize();
+        }
+    },
+
+    watchForResize: function () {
+        // from http://stackoverflow.com/questions/1248081/get-the-browser-viewport-dimensions-with-javascript
+        var w = Math.max(document.documentElement.clientWidth, window.innerWidth || 0);
+        var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0);
+
+        if ((w !== this.ww) || (h !== this.hh)) {
+            resize();
+        }
+
+        var $this=this;
+        window.setTimeout(function(){
+            $this.watchForResize();
+        }, 1000);
     },
+
     resize: function (init, forceOrientation) {
         if (init == undefined || init == null) {
             init = false;
index b9a7233fa15ecf83a34ed3aaf83ad99c5870f5c2..dd76b1d61d80081f28342a02b45dcb1dc34b9586 100644 (file)
@@ -108,7 +108,7 @@ FluidbookSupport.prototype = {
         var $this = this;
 
         if (!isMobile(false)) {
-            $(window).resize(function () {
+            $(window).on('resize', function () {
                 resize();
             });
         } else {
index 3a39dd0380f36e782a1517efc5194bab0c283e48..e298400d740dc477540ab3e1b7e6cc9df4f15a11 100644 (file)
@@ -34,7 +34,11 @@ function initScorm() {
     }
     console.log('init scorm');
     SCORM_INITED = true;
-    pipwerks.SCORM.init();
+    try {
+        pipwerks.SCORM.init();
+    }catch (e) {
+        
+    }
     setScormValue('exit', 'suspend');
     startScormTimer();