mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-12-16 21:40:23 +01:00
closes #1758
This commit is contained in:
@@ -62,7 +62,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
|
||||
handleBookmark(tid);
|
||||
|
||||
navigator.init('.posts > .post-row', postCount, Topic.navigatorCallback);
|
||||
navigator.init('.posts > .post-row', postCount, Topic.navigatorCallback, Topic.toTop, Topic.toBottom);
|
||||
|
||||
socket.on('event:new_post', onNewPost);
|
||||
|
||||
@@ -74,6 +74,16 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT
|
||||
socket.emit('topics.increaseViewCount', tid);
|
||||
};
|
||||
|
||||
Topic.toTop = function() {
|
||||
navigator.scrollTop(1);
|
||||
};
|
||||
|
||||
Topic.toBottom = function() {
|
||||
socket.emit('topics.lastPostIndex', ajaxify.variables.get('topic_id'), function(err, index) {
|
||||
navigator.scrollBottom(index);
|
||||
});
|
||||
};
|
||||
|
||||
function handleBookmark(tid) {
|
||||
var bookmark = localStorage.getItem('topic:' + tid + ':bookmark');
|
||||
var postIndex = getPostIndex();
|
||||
|
||||
Reference in New Issue
Block a user