added client side hooks: "action:topic.loading" and "action:topic.loaded"

v1.18.x
Julian Lam 12 years ago
parent 27381bfc35
commit 7ea379d4f1

@ -42,6 +42,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
Topic.postCount = templates.get('postcount'); Topic.postCount = templates.get('postcount');
$(window).trigger('action:topic.loading');
function fixDeleteStateForPosts() { function fixDeleteStateForPosts() {
var postEls = document.querySelectorAll('#post-container li[data-deleted]'); var postEls = document.querySelectorAll('#post-container li[data-deleted]');
@ -446,7 +447,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
var post = $(this).parents('.post-row'), var post = $(this).parents('.post-row'),
pid = post.attr('data-pid'), pid = post.attr('data-pid'),
upvoted = post.find('.upvoted').length; upvoted = post.find('.upvoted').length;
if (upvoted) { if (upvoted) {
socket.emit('posts.unvote', { socket.emit('posts.unvote', {
pid: pid, pid: pid,
@ -458,7 +459,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
room_id: app.currentRoom room_id: app.currentRoom
}); });
} }
return false; return false;
}); });
@ -478,7 +479,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
room_id: app.currentRoom room_id: app.currentRoom
}); });
} }
return false; return false;
}); });
@ -1050,6 +1051,7 @@ define(['composer', 'forum/pagination'], function(composer, pagination) {
} }
$(window).on('scroll', updateHeader); $(window).on('scroll', updateHeader);
$(window).trigger('action:topic.loaded');
}; };
function updateHeader() { function updateHeader() {

Loading…
Cancel
Save