]> _ Git - fluidbook-html5.git/commitdiff
wip #2217 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Sep 2018 16:55:12 +0000 (18:55 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Thu, 20 Sep 2018 16:55:12 +0000 (18:55 +0200)
js/libs/fluidbook/fluidbook.js

index 26a087b6fd1e2124dfdabb8092ea61a943391514..a731c24ab143ce02b424156bb1ed780584e38c96 100644 (file)
@@ -105,6 +105,7 @@ Fluidbook.prototype = {
     },
 
     setMaxPage: function (p, allowbackwards) {
+        var currentMaxPage = this.maxPage;
         if (allowbackwards === undefined) {
             allowbackwards = false;
         }
@@ -117,6 +118,9 @@ Fluidbook.prototype = {
         }
 
         this.maxPage = Math.min(p, this.datas.pages);
+        if (currentMaxPage === this.maxPage) {
+            return;
+        }
         $(this).trigger('fluidbook.maxpage.set', [this.maxPage]);
         this.updateMaxPage();
     },