From: Vincent Vanwaelscappel Date: Tue, 19 Mar 2019 15:24:21 +0000 (+0100) Subject: try #2640 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=644bf7dabe73093bd3f201d3baa506c739de0414;p=fluidbook-html5.git try #2640 @0:20 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 74345e86..3aa0a0c7 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -411,15 +411,16 @@ Fluidbook.prototype = { defaultStartPage = FLUIDBOOK_START_PAGE; } + if (args.length <= 1 || args[1] == '' || args[1] == undefined) { if (this.landingpage !== undefined && this.landingpage.hasLandingPage) { window.location.hash = '/landing'; return; } return this.setCurrentPage(defaultStartPage); - } else if (args[1] == 'closeview') { + } else if (args[1] === 'closeview') { return this.setCurrentPage(this.currentPage); - } else if (args[1] == 'page') { + } else if (args[1] === 'page') { if (fluidbook.datas.pageLabels[args[2]] !== undefined) { page = fluidbook.datas.pageLabels[args[2]]; } else { @@ -429,7 +430,7 @@ Fluidbook.prototype = { return this.setCurrentPage('1'); } - if (page != $this.currentPage) { + if (page !== $this.currentPage) { $($this).trigger('fluidbook.page.navigation', [page]); $($this).trigger('changePage', [page]); } @@ -437,7 +438,7 @@ Fluidbook.prototype = { this.landingpage.hide(); } this.menu._closeView(function () { - if (page != $this.currentPage) { + if (page !== $this.currentPage) { $this.pagetransitions.pageTransition(page); $this.stats.track(0, page); } @@ -445,13 +446,20 @@ Fluidbook.prototype = { $this.hideSplash(); }, true); - } else if (args[1] == 'landing') { + } else if (args[1] === 'landing') { $this.hideSplash(); if (this.landingpage !== undefined) { this.landingpage.show(); } } else { var view = args[1]; + if (view.match(/^[0-9]*$/)) { + var pageNrFlashURL = parseInt(view); + if (!isNaN(pageNrFlashURL)) { + this.setCurrentPage(pageNrFlashURL); + } + } + if (this.currentPage === -1) { if (view === 'multimedia' || view === 'video' || view === 'iframe') { var searchURL = args.join('/');