]> _ Git - fluidbook-html5.git/commitdiff
try #2640 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Mar 2019 15:24:21 +0000 (16:24 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 19 Mar 2019 15:24:21 +0000 (16:24 +0100)
js/libs/fluidbook/fluidbook.js

index 74345e86867ffc5cf30271eca18a920b3a5f0e60..3aa0a0c78de8dbd45975dc4a99c1b3aca43b5bc7 100644 (file)
@@ -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('/');