From 1ced89a869483e693540129df64efd4411a50058 Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 21 Sep 2023 09:14:15 +0000 Subject: fix javascript error --- view/js/main.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'view/js') diff --git a/view/js/main.js b/view/js/main.js index ced1a517e..d022ee4a9 100644 --- a/view/js/main.js +++ b/view/js/main.js @@ -1584,7 +1584,7 @@ function zFormError(elm,x) { $(window).scroll(function () { if(typeof buildCmd == 'function') { // This is a content page with items and/or conversations - if($(window).scrollTop() + $(window).height() > $('#conversation-end').position().top) { + if($('#conversation-end').length && ($(window).scrollTop() + $(window).height()) > $('#conversation-end').position().top) { if((pageHasMoreContent) && (! loadingPage)) { next_page++; scroll_next = true; @@ -1595,7 +1595,7 @@ $(window).scroll(function () { } else { // This is some other kind of page - perhaps a directory - if($('#page-end').length && ($(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