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