From 182dec3e574a1db1f737b1ff2f4a6423a0911b1d Mon Sep 17 00:00:00 2001 From: Max Kostikov Date: Mon, 8 Mar 2021 15:33:26 +0000 Subject: Fix undefined page end on non dynamic pages --- view/js/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'view') diff --git a/view/js/main.js b/view/js/main.js index 0c48c8b18..16dcd9cfe 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1574,7 +1574,7 @@ $(window).scroll(function () { } else { // This is some other kind of page - perhaps a directory - if($(window).scrollTop() + $(window).height() > $('#page-end').position().top) { + if($('#page-end').length && ($(window).scrollTop() + $(window).height() > $('#page-end').position().top)) { if((pageHasMoreContent) && (! loadingPage) && (! justifiedGalleryActive)) { next_page++; scroll_next = true; -- cgit v1.2.3