From: Vincent Vanwaelscappel Date: Wed, 2 Jan 2019 19:09:49 +0000 (+0100) Subject: wip #2332 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=2ae26a18cd14efb60f1a837fa348f6500db807a5;p=fluidbook-html5.git wip #2332 --- diff --git a/js/libs/fluidbook/fluidbook.3dflip.js b/js/libs/fluidbook/fluidbook.3dflip.js index c8fa6331..a9660dae 100644 --- a/js/libs/fluidbook/fluidbook.3dflip.js +++ b/js/libs/fluidbook/fluidbook.3dflip.js @@ -247,7 +247,6 @@ Fluidbook3DFlip.prototype = { this.scene.add(new THREE.AmbientLight(0xffffff, 1.5)); } - var zoom = 0.8; var far = 24000 * zoom; var near = 1000; @@ -370,9 +369,7 @@ Fluidbook3DFlip.prototype = { this.renderer.setSize(this.pw, this.ph); // Empty element before - while (this.container.firstChild) { - this.container.removeChild(this.container.firstChild); - } + this.jcontainer.empty(); this.container.appendChild(this.renderer.domElement); this.initAnimations(); diff --git a/js/libs/fluidbook/fluidbook.search.js b/js/libs/fluidbook/fluidbook.search.js index d2d2a24f..a881deb9 100644 --- a/js/libs/fluidbook/fluidbook.search.js +++ b/js/libs/fluidbook/fluidbook.search.js @@ -602,7 +602,7 @@ FluidbookSearch.prototype = { return; } - if (totalHits == 0) { + if (totalHits === 0) { // Should pages with no results still be shown? if ($this.fluidbook.datas.searchShowNoResultsPages) { $(this).append('
'); diff --git a/js/widget.js b/js/widget.js index a330f2e6..1461c7a0 100644 --- a/js/widget.js +++ b/js/widget.js @@ -160,7 +160,7 @@ $(function () { var leftPage = $('.p[data-page=' + page + ']'); var rightPage = $('.p[data-page=' + (page + 1) + ']'); - if (!transition || this.transition == 'none') { + if (!transition || this.transition === 'none') { $("#nextDoublePage .p,#currentDoublePage .p").hide().appendTo(this.e); $("#currentDoublePage").append($(leftPage)).append($(rightPage)); $(leftPage).show(); @@ -176,7 +176,7 @@ $(function () { $("#nextDoublePage").remove(); this.animating = false; } else { - if (this.transition == '2d') { + if (this.transition === '2d') { $("#widget").css('overflow', 'hidden'); this.e.append('
'); $(leftPage).show(); @@ -211,10 +211,10 @@ $(function () { $this.gotoPage(page, false) }); } - } else if (this.transition == '3d') { + } else if (this.transition === '3d') { $("#widget").css('overflow', 'visible'); var nextFromClass; - if (this.dir == 1) { + if (this.dir === 1) { nextFromClass = 'next'; } else { nextFromClass = 'prev'; @@ -225,7 +225,7 @@ $(function () { $("#currentDoublePage .p").hide().appendTo(this.e); var leftTurn, rightTurn; - if (this.dir == 1) { + if (this.dir === 1) { leftPage = $('.p[data-page=' + this.currentPage + ']'); rightPage = $('.p[data-page=' + (page + 1) + ']'); leftTurn = $('.p[data-page=' + page + ']'); @@ -243,7 +243,7 @@ $(function () { $(rightTurn).show(); $("#currentDoublePage").append($(leftPage)).append($(rightPage)); - if (this.dir == -1) { + if (this.dir === -1) { $("#nextDoublePage").append($(leftTurn)).append($(rightTurn)); } else { $("#nextDoublePage").append($(rightTurn)).append($(leftTurn)); @@ -265,7 +265,7 @@ $(function () { }, goNextPage: function () { var p; - if (this.dir == 1) { + if (this.dir === 1) { p = this.currentPage + 2; if (p > this.to) { p -= 4;