From: Vincent Vanwaelscappel Date: Thu, 14 May 2020 09:35:46 +0000 (+0200) Subject: fix #3642 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=a56ce6d47cdbac6af6e732fd73e9244d6936c8ca;p=fluidbook-html5.git fix #3642 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.tabs.js b/js/libs/fluidbook/fluidbook.tabs.js index ff346aea..6323a601 100644 --- a/js/libs/fluidbook/fluidbook.tabs.js +++ b/js/libs/fluidbook/fluidbook.tabs.js @@ -112,9 +112,18 @@ FluidbookTabs.prototype = { if (this.hasSections()) { $.each(this.sections, function (id, limit) { var sectionPages = []; + var foundOnePage = false; $.each(pages, function (k, p) { - if ($this.getSectionByPageNumber(p) - 1 === id) { + if (p === '-' && foundOnePage) { sectionPages.push(p); + } else { + if ($this.getSectionByPageNumber(p) - 1 === id) { + foundOnePage = true; + sectionPages.push(p); + } else if (foundOnePage) { + // Assume that if this page is not in the current section, next ones won't be either + return false; + } } }); sections.push(sectionPages);