]> _ Git - fluidbook-html5.git/commitdiff
wip #4866 @0:15
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Nov 2021 14:18:00 +0000 (15:18 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 12 Nov 2021 14:18:00 +0000 (15:18 +0100)
js/libs/fluidbook/fluidbook.js

index 6bc2a909f18b5d8cc2cac4eb9803561d2d3bc139..461ee75aa6b8c867742e157df85bebcc23edeb2d 100644 (file)
@@ -431,8 +431,10 @@ Fluidbook.prototype = {
             return this.setCurrentPage(this.currentPage);
         } else if (args[1] === 'page') {
             var anchor = this.normalizeAnchor(args[2]);
-            if (this.settings.pageLabels[args[2]] !== undefined) {
+            console.log(anchor, this.settings.pageLabels[anchor]);
+            if (this.settings.pageLabels[anchor] !== undefined) {
                 page = this.settings.pageLabels[anchor];
+                console.log(anchor, 'ok');
             } else {
                 page = parseInt(args[2]);
                 anchor = false;
@@ -504,7 +506,7 @@ Fluidbook.prototype = {
     },
 
     normalizeAnchor: function (anchor) {
-        return anchor.toLowerCase().replace('/-/g', '');
+        return anchor.toLowerCase().replace(/-/g, '');
     },
 
     scrollToAnchor: function (anchor) {