mirror of
https://github.com/friendica/friendica
synced 2024-12-22 23:20:16 +00:00
Bugfix: There were speed problems with inifinite scroll on firefox
This commit is contained in:
parent
eaefcf9de7
commit
0b31aa963d
2 changed files with 13 additions and 9 deletions
|
@ -267,9 +267,11 @@ function bb_ShareAttributes($match) {
|
||||||
preg_match('/posted="(.*?)"/ism', $attributes, $matches);
|
preg_match('/posted="(.*?)"/ism', $attributes, $matches);
|
||||||
if ($matches[1] != "")
|
if ($matches[1] != "")
|
||||||
$posted = $matches[1];
|
$posted = $matches[1];
|
||||||
$reldate = (($posted) ? " " . relative_date($posted) : '');
|
|
||||||
|
|
||||||
$headline = '<br /><div class="shared_header">';
|
$reldate = (($posted) ? " " . relative_date($posted) : '');
|
||||||
|
|
||||||
|
$headline = '<div class="shared_header">';
|
||||||
|
//$headline = '<br /><div class="shared_header">';
|
||||||
|
|
||||||
if ($avatar != "")
|
if ($avatar != "")
|
||||||
$headline .= '<img src="'.$avatar.'" height="32" width="32" >';
|
$headline .= '<img src="'.$avatar.'" height="32" width="32" >';
|
||||||
|
|
16
index.php
16
index.php
|
@ -494,13 +494,15 @@ var num = $pageno;
|
||||||
|
|
||||||
$(window).scroll(function(e){
|
$(window).scroll(function(e){
|
||||||
|
|
||||||
// First method that is expected to work - but has problems with Chrome
|
if ($(document).height() != $(window).height()) {
|
||||||
if ($(window).scrollTop() == $(document).height() - $(window).height())
|
// First method that is expected to work - but has problems with Chrome
|
||||||
loadcontent();
|
if ($(window).scrollTop() == $(document).height() - $(window).height())
|
||||||
|
loadcontent();
|
||||||
// This method works with Chrome
|
} else {
|
||||||
if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height()))
|
// This method works with Chrome - but seems to be much slower in Firefox
|
||||||
loadcontent();
|
if ($(window).scrollTop() > (($("section").height() + $("header").height() + $("footer").height()) - $(window).height()))
|
||||||
|
loadcontent();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue