mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-10 07:55:46 +01:00
scroll fix
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user