scroll fix

This commit is contained in:
Baris Soner Usakli
2014-02-28 00:59:35 -05:00
parent 9b4ca12dc1
commit 8064f7f0db
2 changed files with 1 additions and 10 deletions

View File

@@ -1027,14 +1027,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
}
$('#pagination').html(index + ' out of ' + Topic.postCount);
$('.progress-bar').width((index / Topic.postCount * 100) + '%');
return false;
}
});
$('.posts > .post-row').each(function() {
var el = $(this);
if (elementInView(el)) {
if(!parseInt(el.attr('data-index'), 10)) {
localStorage.removeItem('topic:' + templates.get('topic_id') + ':bookmark');
} else {
@@ -1063,7 +1056,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
var elTop = el.offset().top;
var elBottom = elTop + Math.floor(el.height());
return !(elTop > scrollBottom || elBottom < scrollTop);
return (elTop >= scrollTop && elBottom <= scrollBottom) || (elTop <= scrollTop && elBottom >= scrollTop);
}
Topic.scrollToPost = function(pid, highlight, duration, offset) {