]> _ Git - fluidbook-html5.git/commitdiff
fix #2803 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 May 2019 15:04:04 +0000 (17:04 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 28 May 2019 15:04:04 +0000 (17:04 +0200)
js/libs/fluidbook/fluidbook.js
js/libs/fluidbook/fluidbook.loader.js
js/libs/fluidbook/fluidbook.print.js

index d246ddbb47db1d6ca4c993ed94db25defd24e3f0..2f8cc0e7d90860b8cb84c52ab0a1fd61cf96a32d 100644 (file)
@@ -171,9 +171,7 @@ Fluidbook.prototype = {
             $this.goFirstPage();
         });
         key('end', function () {
-
             $this.goLastPage();
-
         });
         key('left', function () {
             if ($this.l10n.dir === 'ltr') {
index 94911d5b85d7a2a2f26b38d7c10fe51a5119a43d..81aaf3240380d760476ed520dce4a20febb9225c 100644 (file)
@@ -601,51 +601,15 @@ FluidbookLoader.prototype = {
         if (shade) {
             s = '<div class="shade"></div>';
         }
-        return '<div class="pageholder"' + pageHolderStyle + '>' + this.loadThumb(page, function () {
-        }).get(0).outerHTML + s + '</div>';
-    },
-
-    // getThumbImage: function (page, div, shade, width) {
-    //     var returnHTML = false;
-    //     if (div === null || div == undefined) {
-    //         div = $('<div />');
-    //     }
-    //     if (width == undefined) {
-    //         width = 100;
-    //     }
-    //
-    //     left = ((page % 2 === 0) && this.fluidbook.l10n.ltr) || ((page % 2 == 1) && this.fluidbook.l10n.rtl);
-    //
-    //     var h = width * (this.fluidbook.datas.thumbHeight / 100);
-    //
-    //     var shadeImage = '';
-    //     var shadePosition = '';
-    //     var shadeSize = '';
-    //
-    //     if (shade) {
-    //         var p = '0%';
-    //         var i = 'right';
-    //         if (left) {
-    //             p = '100%';
-    //             i = 'left';
-    //         }
-    //         shadeImage = 'url("images/shadows/thumbnails/' + i + '.png"),';
-    //
-    //         shadePosition = p + " 0%,";
-    //         shadeSize = (width / 2) + 'px ' + h + 'px,';
-    //     }
-    //
-    //     var thumbImage = 'url("data/thumbnails/p' + page + '.jpg")';
-    //     var thumbPosition = '0px 0px';
-    //     var thumbSize = '100% 100%';
-    //
-    //     $(div).css({
-    //         backgroundImage: shadeImage + thumbImage,
-    //         backgroundPosition: shadePosition + thumbPosition,
-    //         backgroundSize: shadeSize + thumbSize
-    //     }).addClass('img');
-    //     return $(div).get(0).outerHTML;
-    // },
+        var thumb = this.loadThumb(page, function () {
+        });
+        var thumbhtml = '';
+        if (thumb !== undefined && thumb.length > 0) {
+            thumbhtml = thumb.get(0).outerHTML;
+        }
+        return '<div class="pageholder"' + pageHolderStyle + '>' + thumbhtml + s + '</div>';
+    },
+
     loadImage: function (src, width, height, type, page, cb) {
         var $this = this;
         var callback = function () {
index 835a2b26ec4ac07993d9470639db32a430aa413f..42c61e02afc9b1e0d63af202f93eb5d28883b6f6 100644 (file)
@@ -82,11 +82,11 @@ FluidbookPrint.prototype = {
         mode = (mode === 'download' ? mode : 'print');
 
         // Todo: handle RTL differences for page numbers? See fluidbook.index.js for example
-        var leftPageNumber = this.fluidbook.getPhysicalPageNumberOfSide('left'),
-            rightPageNumber = this.fluidbook.getPhysicalPageNumberOfSide('right'),
-            isFirstPage = (this.fluidbook.currentPage == 0),
-            isLastPage = (this.fluidbook.currentPage == this.fluidbook.datas.pages),
-            isSinglePageMode = (this.fluidbook.resize.orientation == 'portrait'),
+        var leftPageNumber = this.fluidbook.getPhysicalPageNumberOfSide(this.fluidbook.l10n.dir === 'ltr' ? 'left' : 'right'),
+            rightPageNumber = this.fluidbook.getPhysicalPageNumberOfSide(this.fluidbook.l10n.dir === 'ltr' ? 'right' : 'left'),
+            isFirstPage = (this.fluidbook.currentPage === 0),
+            isLastPage = (this.fluidbook.currentPage === this.fluidbook.datas.pages),
+            isSinglePageMode = (this.fluidbook.resize.orientation === 'portrait'),
             buttonLabels = {
                 'print': __('print'),
                 'download': __('download')