From: Vincent Vanwaelscappel Date: Fri, 26 Oct 2018 09:26:52 +0000 (+0200) Subject: wait #2277 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=973c6eb3d694f83ea1ec167d43d80a2003ce46d9;p=fluidbook-html5.git wait #2277 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.contentlock.js b/js/libs/fluidbook/fluidbook.contentlock.js index 489a4cee..889263c8 100644 --- a/js/libs/fluidbook/fluidbook.contentlock.js +++ b/js/libs/fluidbook/fluidbook.contentlock.js @@ -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) } }, diff --git a/js/libs/fluidbook/fluidbook.video.js b/js/libs/fluidbook/fluidbook.video.js index 806df50e..8de11876 100644 --- a/js/libs/fluidbook/fluidbook.video.js +++ b/js/libs/fluidbook/fluidbook.video.js @@ -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