]> _ Git - fluidbook-html5.git/commitdiff
fix #3337 @0:10
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jan 2020 14:32:39 +0000 (15:32 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 14 Jan 2020 14:32:39 +0000 (15:32 +0100)
js/libs/fluidbook/fluidbook.slider.js

index 1ef8e9b5b8d9afd4c2a06ae724f2804a7cbdb8b6..180dc970cb1f7f5dc47c819b6068dbbb7377fc4e 100644 (file)
@@ -182,7 +182,7 @@ FluidbookSlider.prototype = {
         if (this.fluidbook.l10n.rtl) {
             page = this.fluidbook.contentlock.getMaxPage() - page;
         }
-        if (this.fluidbook.resize.orientation == 'portrait') {
+        if (this.fluidbook.resize.orientation === 'portrait') {
             left = this.snapsWidth * (page - 1);
         } else {
             var current = Math.floor(page / 2);
@@ -247,8 +247,12 @@ FluidbookSlider.prototype = {
         thumb.find('.bookmark').attr('data-page', page);
         if (page > 0 && page <= this.fluidbook.contentlock.getMaxPage()) {
             thumb.css('visibility', 'visible');
-            thumb.find('a:not(.bookmark)').attr('href', '#').attr('data-page', page).html(this.fluidbook.loader.getThumbImage(page, shade));
-            thumb.find('.number').text(this.fluidbook.physicalToVirtual(page));
+            var img = this.fluidbook.loader.getThumbImage(page, shade);
+            var link = thumb.find('a:not(.bookmark)');
+            if (page != link.attr('data-page')) {
+                link.attr('href', '#').attr('data-page', page).html(img);
+                thumb.find('.number').text(this.fluidbook.physicalToVirtual(page));
+            }
         } else {
             thumb.css('visibility', 'hidden');
         }