scroll fix

v1.18.x
Baris Soner Usakli 11 years ago
parent 9b4ca12dc1
commit 8064f7f0db

@ -446,8 +446,6 @@ var socket,
var previousScrollTop = 0; var previousScrollTop = 0;
app.enableInfiniteLoading = function(callback) { app.enableInfiniteLoading = function(callback) {
$(window).off('scroll').on('scroll', function() { $(window).off('scroll').on('scroll', function() {

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

Loading…
Cancel
Save