From: Vincent Vanwaelscappel Date: Fri, 17 Jul 2020 12:58:53 +0000 (+0200) Subject: fix #3795 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=adf701383133f46448e5990b4174d9d05ea4523a;p=fluidbook-html5.git fix #3795 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.tabs.js b/js/libs/fluidbook/fluidbook.tabs.js index d562a55f..d1703d83 100644 --- a/js/libs/fluidbook/fluidbook.tabs.js +++ b/js/libs/fluidbook/fluidbook.tabs.js @@ -190,6 +190,8 @@ FluidbookTabs.prototype = { } }); + console.log(page, id, this.links); + if (id === 'none') { this.svg.find('[id^="o"].active').removeClass('active'); @@ -308,58 +310,58 @@ FluidbookTabs.prototype = { }); } - if (this.hideOnLastPage || this.hideOnFirstPage) { - if (this.hideOnLastPage) { - this.visibility.lastpage = true; - } - if (this.hideOnFirstPage) { - this.visibility.firstpage = true; - } - $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) { - if ($this.hideOnFirstPage) { - if (page <= 1) { - $this.changeVisibility('firstpage', false); - } + if (this.hideOnLastPage) { + this.visibility.lastpage = true; + } + if (this.hideOnFirstPage) { + this.visibility.firstpage = true; + } + + $(this.fluidbook).on('fluidbook.page.change.start', function (e, page) { + if ($this.hideOnFirstPage) { + if (page <= 1) { + $this.changeVisibility('firstpage', false); } - if ($this.hideOnLastPage) { - var last = $this.fluidbook.settings.pages; - if (last % 2 === 1) { - last--; - } - if (page >= last) { - $this.changeVisibility('lastpage', false); - } + } + if ($this.hideOnLastPage) { + var last = $this.fluidbook.settings.pages; + if (last % 2 === 1) { + last--; } - $this.changePage(page); - }); + if (page >= last) { + $this.changeVisibility('lastpage', false); + } + } + $this.changePage(page); + }); - $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) { - if ($this.hideOnFirstPage) { - if (page > 1) { - $this.changeVisibility('firstpage', true); - } + $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) { + if ($this.hideOnFirstPage) { + if (page > 1) { + $this.changeVisibility('firstpage', true); } - if ($this.hideOnLastPage) { - var last = $this.fluidbook.settings.pages; - if (last % 2 === 1) { - last--; - } - if (page < last) { - $this.changeVisibility('lastpage', true); - } + } + if ($this.hideOnLastPage) { + var last = $this.fluidbook.settings.pages; + if (last % 2 === 1) { + last--; } - }); + if (page < last) { + $this.changeVisibility('lastpage', true); + } + } + }); - $(document).on('mouseover', '.tablink[data-labelid]', function () { - $this.svg.find('[id^="t"].active').removeClass('active'); - $this.svg.find('#' + $(this).data('labelid')).addClass('active'); - }); + $(document).on('mouseover', '.tablink[data-labelid]', function () { + $this.svg.find('[id^="t"].active').removeClass('active'); + $this.svg.find('#' + $(this).data('labelid')).addClass('active'); + }); + + $(document).on('mouseout', '.tablink[data-labelid]', function () { + $this.svg.find('[id^="t"].active').removeClass('active'); + }); - $(document).on('mouseout', '.tablink[data-labelid]', function () { - $this.svg.find('[id^="t"].active').removeClass('active'); - }); - } }, changeVisibility: function (type, visible) {