From 80aea66d915e105a65e5413bea30e568d637df9e Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 20 Sep 2018 18:55:12 +0200 Subject: [PATCH] wip #2217 @0.5 --- js/libs/fluidbook/fluidbook.js | 4 ++++ 1 file changed, 4 insertions(+) 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(); }, -- 2.39.5