From cedfa90d766194a6c07f6b4289d55d712b499040 Mon Sep 17 00:00:00 2001 From: Ghighi Eftimie Date: Sat, 10 Oct 2020 17:51:46 +0300 Subject: [PATCH] fix for #981 --- cps/static/css/caliBlur.css | 6 +++--- cps/static/js/main.js | 13 +++++++++++++ cps/templates/layout.html | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/cps/static/css/caliBlur.css b/cps/static/css/caliBlur.css index 3bf07110..b7d86519 100644 --- a/cps/static/css/caliBlur.css +++ b/cps/static/css/caliBlur.css @@ -637,18 +637,18 @@ div[aria-label="Edit/Delete book"] > .btn > span:hover { color: var(--color-primary) } -.book { +/* .book { width: 225px; max-width: 225px; position: relative !important; - left: auto !important; + left: auto !important; top: auto !important; -webkit-transform: none !important; -ms-transform: none !important; transform: none !important; min-width: 225px; display: block -} +} */ #infscr-loading img, body > div.container-fluid > div > div.col-sm-10 > div.discover > div.isotope:after, body > div.container-fluid > div > div.col-sm-10 > div.discover > div.isotope:before { display: none diff --git a/cps/static/js/main.js b/cps/static/js/main.js index 7312f08d..c04ec65e 100644 --- a/cps/static/js/main.js +++ b/cps/static/js/main.js @@ -187,6 +187,19 @@ $(function() { $(".load-more .row").isotope( "appended", $(data), null ); }); + // fix for infinite scroll on CaliBlur Theme (#981) + if ($(".load-more .row").length && $("body").hasClass("blur")) { + $(".col-sm-10").bind("scroll", function () { + if ( + $(this).scrollTop() + $(this).innerHeight() >= + $(this)[0].scrollHeight + ) { + $loadMore.infiniteScroll("loadNextPage"); + window.history.replaceState({}, null, $loadMore.infiniteScroll('getAbsolutePath')+1) + } + }); + } + $("#restart").click(function() { $.ajax({ dataType: "json", diff --git a/cps/templates/layout.html b/cps/templates/layout.html index c555f556..65867fe7 100644 --- a/cps/templates/layout.html +++ b/cps/templates/layout.html @@ -166,7 +166,7 @@ {% endif %} {% endfor %} {% if pagination.has_next %} -
  • {% endif %}