From: Vincent Vanwaelscappel Date: Mon, 11 Mar 2019 13:54:11 +0000 (+0100) Subject: fix #2627 @0:20 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=c025c90766d87a77d81666c984d0ed6ab5acad28;p=fluidbook-html5.git fix #2627 @0:20 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 8fc5e003..74345e86 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -318,35 +318,35 @@ Fluidbook.prototype = { return offset; }, goNextPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } this.transitionAxis = 'x'; this.setCurrentPage(this.normalizePage(this.currentPage) + this.getNextOffset()); }, goFirstPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } this.transitionAxis = 'x'; this.setCurrentPage(1); }, goPreviousPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } this.transitionAxis = 'x'; this.setCurrentPage(this.normalizePage(this.currentPage) - this.getNextOffset()); }, goLastPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } this.transitionAxis = 'x'; this.setCurrentPage(this.contentlock.getMaxPage()); }, goNextChapter: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } var next = this.bookmarks.getNextGroupCover(this.currentPage); @@ -357,7 +357,7 @@ Fluidbook.prototype = { this.setCurrentPage(this.normalizePage(next)); }, goPreviousChapter: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } var prev = this.bookmarks.getPreviousGroupCover(this.currentPage); @@ -368,7 +368,7 @@ Fluidbook.prototype = { this.setCurrentPage(this.normalizePage(prev)); }, goNextChapterPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } @@ -380,7 +380,7 @@ Fluidbook.prototype = { this.setCurrentPage(this.normalizePage(next)); }, goPreviousChapterPage: function () { - if (!this.pagetransitions.canChangePage()) { + if (!this.canChangePage()) { return; } diff --git a/js/libs/fluidbook/fluidbook.slider.js b/js/libs/fluidbook/fluidbook.slider.js index d59da370..6e199483 100644 --- a/js/libs/fluidbook/fluidbook.slider.js +++ b/js/libs/fluidbook/fluidbook.slider.js @@ -9,13 +9,20 @@ function FluidbookSlider(fluidbook) { FluidbookSlider.prototype = { init: function () { + var $this = this; $(document).on('click', function () { $("#slider").removeClass('drag'); return true; - }) + }); + $(document).on('click', '#sliderthumb a[data-page]', function () { + if ($this.fluidbook.canChangePage()) { + $this.fluidbook.setCurrentPage(parseInt($(this).attr('data-page'))); + } + return false; + }); $("#interface").append('
'); - var $this = this; + $(this.fluidbook).on('fluidbook.page.change.end', function (e, page) { $this.updateCursorPosition(); }); @@ -238,7 +245,7 @@ FluidbookSlider.prototype = { if (page > 0 && page <= this.fluidbook.contentlock.getMaxPage()) { thumb.css('visibility', 'visible'); this.fluidbook.loader.getThumbImage(page, thumb.find('.img'), shade); - thumb.find('a').attr('href', '#/page/' + page); + thumb.find('a').attr('href', '#').attr('data-page', page); thumb.find('.number').text(this.fluidbook.physicalToVirtual(page)); } else { thumb.css('visibility', 'hidden');