]> _ Git - fluidbook-html5.git/commitdiff
fix #2627 @0:20
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Mar 2019 13:54:11 +0000 (14:54 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Mon, 11 Mar 2019 13:54:11 +0000 (14:54 +0100)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.slider.js

index 8fc5e003c95e8453a37589e4d17c34cc11fe48eb..74345e86867ffc5cf30271eca18a920b3a5f0e60 100644 (file)
@@ -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;
         }
 
index d59da370427ce99845aef3a41b828b08fcfe3745..6e199483a6f0897e7be092be6a1975bfa42aa89a 100644 (file)
@@ -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('<div id="slider"><div id="sliderthumb"><div class="doubleThumb"><div class="thumb left"><a href="#"><div class="img"></div></a><span class="number"></span><a href="#" class="bookmark left"></a></div><div class="thumb right"><a href="#"><div class="img"></div></a><span class="number"></span><a href="#" class="bookmark right"></a></div></div></div><div id="sliderback"><div class="visible"></div></div><div id="slidercursor"><div class="visible"></div></div></div>');
-        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');