Fixed user list on Chrome w/ endless pagination

This commit is contained in:
Marcin Kurczewski 2014-03-02 18:45:37 +01:00
parent 66229e86be
commit 2af8a941ff
2 changed files with 12 additions and 7 deletions

View file

@ -17,17 +17,13 @@ nav.sort-styles li.active {
.users-wrapper {
text-align: center;
}
.users {
column-width: 20em;
-moz-column-width: 20em;
-webkit-column-width: 20em;
}
.user {
text-align: initial;
line-height: 1.5em;
margin-bottom: 1em;
margin-right: 1em;
float: left;
white-space: pre;
}

View file

@ -1,7 +1,10 @@
function scrolled()
{
var margin = 150;
if ($(document).height() <= $(window).scrollTop() + $(window).height() + margin)
var target = $('.paginator-content:eq(0)');
var y = $(window).scrollTop() + $(window).height();
var maxY = target.height() + target.position().top;
if (y >= maxY - margin)
{
var pageNext = $(document).data('page-next');
var pageDone = $(document).data('page-done');
@ -17,7 +20,13 @@ function scrolled()
var dom = $(response);
var nextPage = dom.find('.paginator .next:not(.disabled) a').attr('href');
$(document).data('page-next', nextPage);
$('.paginator-content').append($(response).find('.paginator-content').children().css({opacity: 0}).animate({opacity: 1}, 'slow'));
var source = $(response).find('.paginator-content');
target.append(source
.children()
.css({opacity: 0})
.animate({opacity: 1}, 'slow'));
$('body').trigger('dom-update');
scrolled();
});