From: Vincent Vanwaelscappel Date: Thu, 20 Sep 2018 16:55:12 +0000 (+0200) Subject: wip #2217 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=80aea66d915e105a65e5413bea30e568d637df9e;p=fluidbook-html5.git wip #2217 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 26a087b6..a731c24a 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -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(); },