From 0b31aa963d6965be00cdf25b7842b6d825cb1116 Mon Sep 17 00:00:00 2001 From: Michael Vogel Date: Sun, 3 Nov 2013 13:47:59 +0100 Subject: [PATCH] Bugfix: There were speed problems with inifinite scroll on firefox --- include/bbcode.php | 6 ++++-- index.php | 16 +++++++++------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/bbcode.php b/include/bbcode.php index 081e4b7c6b..e63a8d394e 100644 --- a/include/bbcode.php +++ b/include/bbcode.php @@ -267,9 +267,11 @@ function bb_ShareAttributes($match) { preg_match('/posted="(.*?)"/ism', $attributes, $matches); if ($matches[1] != "") $posted = $matches[1]; - $reldate = (($posted) ? " " . relative_date($posted) : ''); - $headline = '
'; + $reldate = (($posted) ? " " . relative_date($posted) : ''); + + $headline = '
'; + //$headline = '
'; if ($avatar != "") $headline .= ''; diff --git a/index.php b/index.php index 3255a80517..87795ade70 100644 --- a/index.php +++ b/index.php @@ -494,13 +494,15 @@ var num = $pageno; $(window).scroll(function(e){ - // First method that is expected to work - but has problems with Chrome - if ($(window).scrollTop() == $(document).height() - $(window).height()) - loadcontent(); - - // This method works with Chrome - if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height())) - loadcontent(); + if ($(document).height() != $(window).height()) { + // First method that is expected to work - but has problems with Chrome + if ($(window).scrollTop() == $(document).height() - $(window).height()) + loadcontent(); + } else { + // This method works with Chrome - but seems to be much slower in Firefox + if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height())) + loadcontent(); + } }); -- 2.39.5