|
|
|
@ -363,6 +363,7 @@
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
socket.on('event:new_post', function(data) {
|
|
|
|
|
data.posts[0].display_moderator_tools = 'none';
|
|
|
|
|
var html = templates.prepare(templates['topic'].blocks['posts']).parse(data),
|
|
|
|
|
uniqueid = new Date().getTime();
|
|
|
|
|
|
|
|
|
@ -372,6 +373,11 @@
|
|
|
|
|
.append(html)
|
|
|
|
|
.fadeIn('slow');
|
|
|
|
|
|
|
|
|
|
socket.once('api:post.privileges', function(privileges) {
|
|
|
|
|
if (privileges.editable) toggle_mod_tools(data.posts[0].pid, true);
|
|
|
|
|
});
|
|
|
|
|
socket.emit('api:post.privileges', data.posts[0].pid);
|
|
|
|
|
|
|
|
|
|
set_up_posts(uniqueid);
|
|
|
|
|
|
|
|
|
|
addCommasToNumbers();
|
|
|
|
@ -671,4 +677,18 @@
|
|
|
|
|
replyEl.addClass('none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function toggle_mod_tools(pid, state) {
|
|
|
|
|
var postEl = $(document.querySelector('#post-container li[data-pid="' + pid + '"]')),
|
|
|
|
|
editEl = postEl.find('.edit'),
|
|
|
|
|
deleteEl = postEl.find('.delete');
|
|
|
|
|
|
|
|
|
|
if (state) {
|
|
|
|
|
editEl.removeClass('none');
|
|
|
|
|
deleteEl.removeClass('none');
|
|
|
|
|
} else {
|
|
|
|
|
editEl.addClass('none');
|
|
|
|
|
deleteEl.addClass('none');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})();
|