]> _ Git - fluidbook-html5.git/commitdiff
wait #2277 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 26 Oct 2018 09:26:52 +0000 (11:26 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 26 Oct 2018 09:26:52 +0000 (11:26 +0200)
js/libs/fluidbook/fluidbook.contentlock.js
js/libs/fluidbook/fluidbook.video.js

index 489a4ceeffbb30dfa899bb6c8d4ba04655ef6a21..889263c8899dae050a6904f59a54d729ac6034d6 100644 (file)
@@ -24,12 +24,12 @@ FluidbookContentLock.prototype = {
 
         $.each(this.locks, function (k, v) {
             if (v.unlocked === 1) {
-                return;
+                return true;
             }
             res = k;
-            return true;
+            return false;
         });
-        return res;
+        return parseInt(res);
     },
 
     setMaxPage: function (p, allowbackwards) {
@@ -65,7 +65,7 @@ FluidbookContentLock.prototype = {
         var $this = this;
         $.each(this.locks, function (k, v) {
                 if ($this.maxPage > k) {
-                    $this.locks.unlocked = 1;
+                    $this.locks[k].unlocked = 1;
                 }
             }
         );
@@ -83,13 +83,11 @@ FluidbookContentLock.prototype = {
             this.linksActions[linkId].push(action);
         }
 
-        console.log(this.linksActions);
-
         this.testConditions();
     },
 
     testConditions: function () {
-        var $this=this;
+        var $this = this;
         var change = false;
         $.each(this.locks, function (k, v) {
             if (v.unlocked === 1) {
@@ -112,7 +110,7 @@ FluidbookContentLock.prototype = {
             }
         });
 
-        if (change) {
+        if (change || this.getNextLockPage() !== this.getMaxPage()) {
             this.setMaxPage(this.getNextLockPage(), false)
         }
     },
index 806df50ed0378b537cb97137fd2625cf4e205c87..8de11876c827107b99ec4040eb81562c43e4c438 100644 (file)
@@ -468,8 +468,12 @@ FluidbookVideo.prototype = {
         var $this = this;
         $(e).find('.videoContainer').each(function () {
             var id = $(this).data('id');
-            var player = videojs(id);
-            $this.disposeVideo(player);
+            try {
+                var player = videojs(id);
+                $this.disposeVideo(player);
+            }catch (e) {
+                
+            }
         });
     },
 };
\ No newline at end of file