display_moderator_tools is already returned

when new posts were loaded, we were making a socket call for each post
to check if the post is editable, but this data is already returned in
display_moderator_tools when posts are loaded.
This commit is contained in:
barisusakli
2014-03-25 13:52:25 -04:00
parent e4fbb31e68
commit 2507d6c853
2 changed files with 1 additions and 20 deletions

View File

@@ -775,17 +775,8 @@ define(['forum/pagination', 'forum/topic/threadTools', 'forum/topic/postTools'],
function onNewPostsLoaded(html, posts) {
function getPostPrivileges(pid) {
socket.emit('posts.getPrivileges', pid, function(err, privileges) {
if(err) {
return app.alertError(err.message);
}
toggle_mod_tools(privileges.pid, privileges.editable);
});
}
for (var x = 0, numPosts = posts.length; x < numPosts; x++) {
getPostPrivileges(posts[x].pid);
toggle_mod_tools(posts[x].pid, posts[x].display_moderator_tools);
}
infiniteLoaderActive = false;