From 01e8cedabc7430ac0c1b00eeaaf29d8727ca85b9 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Mon, 13 May 2019 19:02:24 +0200 Subject: [PATCH] wip #2721 @1.5 --- js/libs/fluidbook/fluidbook.loader.js | 4 ++-- js/libs/fluidbook/fluidbook.mobilefirst.js | 23 ++++++++++++++++++++++ style/fluidbook.less | 4 ++-- style/mobilefirst.less | 7 +++++++ 4 files changed, 34 insertions(+), 4 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.loader.js b/js/libs/fluidbook/fluidbook.loader.js index 8c7657d0..dbfd75e5 100644 --- a/js/libs/fluidbook/fluidbook.loader.js +++ b/js/libs/fluidbook/fluidbook.loader.js @@ -598,8 +598,8 @@ FluidbookLoader.prototype = { if (shade) { s = '
'; } - return this.loadThumb(page, function () { - }).get(0).outerHTML + s; + return '
' + this.loadThumb(page, function () { + }).get(0).outerHTML + s + '
'; }, // getThumbImage: function (page, div, shade, width) { diff --git a/js/libs/fluidbook/fluidbook.mobilefirst.js b/js/libs/fluidbook/fluidbook.mobilefirst.js index 3d327333..be087d0f 100644 --- a/js/libs/fluidbook/fluidbook.mobilefirst.js +++ b/js/libs/fluidbook/fluidbook.mobilefirst.js @@ -124,5 +124,28 @@ FluidbookMobileFirst.prototype = { useBothWheelAxes: true }); $("#indexViewHolder").find('.ps__rail-x').addClass('ps--clicking'); + + // Cut tall pages + $("#indexViewHolder .pageholder.cut").css('max-height', null).removeClass('cut'); + var scrollAmount = Math.max(0, $("#indexView").outerHeight() - parseFloat($(".mview .content").css('max-height'))); + console.log('scrollamount', scrollAmount); + if (scrollAmount > 0) { + var tallerHeight = 0; + $("#indexViewHolder .pageholder img").each(function () { + tallerHeight = Math.max(tallerHeight, $(this).outerHeight()) + }); + console.log(tallerHeight); + var cutHeight = tallerHeight - scrollAmount; + console.log(tallerHeight, cutHeight); + $("#indexViewHolder .pageholder img").each(function () { + if ($(this).outerHeight() > cutHeight) { + var holder = $(this).closest('.pageholder'); + holder.addClass('cut').css('max-height', cutHeight); + holder.closest('.thumb').css('height', cutHeight); + holder.closest('.doubleThumb').css('height', cutHeight); + } + }) + } + }, } \ No newline at end of file diff --git a/style/fluidbook.less b/style/fluidbook.less index 8c35dd29..625ed13b 100644 --- a/style/fluidbook.less +++ b/style/fluidbook.less @@ -1909,9 +1909,9 @@ form input[type="text"], form input[type="email"] { img { width: 100%; - height: 100%; + height: auto; background-color: #fff; - position: absolute; + position: relative; z-index: 1; top: 0; left: 0; diff --git a/style/mobilefirst.less b/style/mobilefirst.less index 1754e971..d34a5bee 100644 --- a/style/mobilefirst.less +++ b/style/mobilefirst.less @@ -93,6 +93,13 @@ white-space: nowrap; padding: 25px 20px; + .pageholder { + height: 100%; + &.cut { + overflow: hidden; + } + } + .ps__rail-x { margin: 0 25px; transform: translate(0, -25px) !important; -- 2.39.5