From: Vincent Vanwaelscappel Date: Thu, 26 Jul 2018 13:10:36 +0000 (+0200) Subject: fix #2163 @2 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=4fa5976cf1ffcb220e061eefd5dfb89dc849dcd0;p=fluidbook-html5.git fix #2163 @2 --- diff --git a/js/libs/fluidbook/menu/fluidbook.chapters.js b/js/libs/fluidbook/menu/fluidbook.chapters.js index bbc8d5f2..dc494f4b 100644 --- a/js/libs/fluidbook/menu/fluidbook.chapters.js +++ b/js/libs/fluidbook/menu/fluidbook.chapters.js @@ -145,10 +145,17 @@ FluidbookChapters.prototype = { var level = chapter.level - baseLevel; var p = ''; + var pdisplay = ''; if (chapter.page != '') { - p = this.fluidbook.virtualToPhysical(chapter.page); + if (this.fluidbook.datas.chaptersPageNumber == 'virtual') { + p = this.fluidbook.virtualToPhysical(chapter.page); + pdisplay = chapter.page; + } else { + p = chapter.page; + pdisplay = this.fluidbook.physicalToVirtual(p); + } if (p === false) { - p=''; + p = ''; href = this.cascade ? 'href="#"' : "nohref"; } else { href = 'href="#/page/' + p + '"'; @@ -168,14 +175,14 @@ FluidbookChapters.prototype = { if (this.style == 'classic') { if (color == '') { if (chapter.page != '') { - res += '' + chapter.page + ''; + res += '' + pdisplay + ''; } } else { res += '
' + getSpriteIcon('interface-chevron') + '
'; } } else { - if (chapter.page != '') { - res += '' + chapter.page + ''; + if (pdisplay != '') { + res += '' + pdisplay + ''; } res += '
'; } @@ -199,7 +206,7 @@ FluidbookChapters.prototype = { } }); - for(var i=0;i<=10;i++) { + for (var i = 0; i <= 10; i++) { $('.mview[data-menu="chapters"] ul.chapters li[data-page=""]').each(function () { if ($(this).find('ul li').length == 0) { $(this).remove();