From 8064f7f0dbed243cf8e698af636377821bc01685 Mon Sep 17 00:00:00 2001 From: Baris Soner Usakli Date: Fri, 28 Feb 2014 00:59:35 -0500 Subject: [PATCH] scroll fix --- public/src/app.js | 2 -- public/src/forum/topic.js | 9 +-------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/public/src/app.js b/public/src/app.js index 3201e2b563..621fd0f44c 100644 --- a/public/src/app.js +++ b/public/src/app.js @@ -446,8 +446,6 @@ var socket, var previousScrollTop = 0; - - app.enableInfiniteLoading = function(callback) { $(window).off('scroll').on('scroll', function() { diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index 1f3c58a24b..84eafc8621 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -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) {