mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-09 15:35:47 +01:00
dont highlight reverse infinite loaded posts
This commit is contained in:
@@ -305,10 +305,10 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
enableInfiniteLoading();
|
enableInfiniteLoading();
|
||||||
|
|
||||||
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
||||||
if(window.location.hash) {
|
if (window.location.hash) {
|
||||||
Topic.scrollToPost(window.location.hash.substr(1));
|
Topic.scrollToPost(window.location.hash.substr(1), true);
|
||||||
} else if(bookmark) {
|
} else if (bookmark) {
|
||||||
Topic.scrollToPost(parseInt(bookmark, 10));
|
Topic.scrollToPost(parseInt(bookmark, 10), true);
|
||||||
} else {
|
} else {
|
||||||
updateHeader();
|
updateHeader();
|
||||||
}
|
}
|
||||||
@@ -351,7 +351,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
loadMorePosts(tid, after, function() {
|
loadMorePosts(tid, after, function() {
|
||||||
fixDeleteStateForPosts();
|
fixDeleteStateForPosts();
|
||||||
if(direction < 0 && el) {
|
if(direction < 0 && el) {
|
||||||
Topic.scrollToPost(el.attr('data-pid'), 0, offset);
|
Topic.scrollToPost(el.attr('data-pid'), false, 0, offset);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -1046,7 +1046,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
return !(elTop > scrollBottom || elBottom < scrollTop);
|
return !(elTop > scrollBottom || elBottom < scrollTop);
|
||||||
}
|
}
|
||||||
|
|
||||||
Topic.scrollToPost = function(pid, duration, offset) {
|
Topic.scrollToPost = function(pid, highlight, duration, offset) {
|
||||||
if (!pid) {
|
if (!pid) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1097,11 +1097,12 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
|
|||||||
}, duration !== undefined ? duration : 400, function() {
|
}, duration !== undefined ? duration : 400, function() {
|
||||||
updateHeader();
|
updateHeader();
|
||||||
|
|
||||||
|
if (highlight) {
|
||||||
scrollTo.parent().addClass('highlight');
|
scrollTo.parent().addClass('highlight');
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
scrollTo.parent().removeClass('highlight');
|
scrollTo.parent().removeClass('highlight');
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user