From a56ce6d47cdbac6af6e732fd73e9244d6936c8ca Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Thu, 14 May 2020 11:35:46 +0200 Subject: [PATCH] fix #3642 @0.5 --- js/libs/fluidbook/fluidbook.tabs.js | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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); -- 2.39.5