From de98df842d8fe49ce2a6cda2ae341630ebb167f4 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Thu, 2 Oct 2014 13:55:01 -0400 Subject: [PATCH] priv fix --- public/src/forum/topic.js | 39 ++++++++++++++++++++++----------------- src/socket.io/posts.js | 12 +++--------- 2 files changed, 25 insertions(+), 26 deletions(-) diff --git a/public/src/forum/topic.js b/public/src/forum/topic.js index bcfdc0187c..d1cf06fa2b 100644 --- a/public/src/forum/topic.js +++ b/public/src/forum/topic.js @@ -337,7 +337,7 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT var height = $(document).height(), scrollTop = $(document).scrollTop(), originalPostEl = $('li[data-index="0"]'); - + // Insert the new post html.insertBefore(before); @@ -361,19 +361,22 @@ define('forum/topic', dependencies, function(pagination, infinitescroll, threadT } function onNewPostsLoaded(html, posts) { - function getPostPrivileges(pid) { - socket.emit('posts.getPrivileges', pid, function(err, privileges) { - if(err) { - return app.alertError(err.message); - } - toggleModTools(html, privileges); - }); - } - for (var x = 0, numPosts = posts.length; x < numPosts; x++) { - getPostPrivileges(posts[x].pid); + var pids = []; + for(var i=0; i