From: Vincent Vanwaelscappel Date: Tue, 28 May 2019 15:04:04 +0000 (+0200) Subject: fix #2803 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=124b36633228ab3f09788611556409be21b23446;p=fluidbook-html5.git fix #2803 @0.5 --- diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index d246ddbb..2f8cc0e7 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -171,9 +171,7 @@ Fluidbook.prototype = { $this.goFirstPage(); }); key('end', function () { - $this.goLastPage(); - }); key('left', function () { if ($this.l10n.dir === 'ltr') { diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 94911d5b..81aaf324 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -601,51 +601,15 @@ FluidbookLoader.prototype = { if (shade) { s = '
'; } - return '
' + this.loadThumb(page, function () { - }).get(0).outerHTML + s + '
'; - }, - - // getThumbImage: function (page, div, shade, width) { - // var returnHTML = false; - // if (div === null || div == undefined) { - // 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 '
' + thumbhtml + s + '
'; + }, + loadImage: function (src, width, height, type, page, cb) { var $this = this; var callback = function () { diff --git a/js/libs/fluidbook/fluidbook.print.js b/js/libs/fluidbook/fluidbook.print.js index 835a2b26..42c61e02 100644 --- a/js/libs/fluidbook/fluidbook.print.js +++ b/js/libs/fluidbook/fluidbook.print.js @@ -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')