post button components

v1.18.x
psychobunny 10 years ago
parent 1d53365707
commit f8af900415

@ -6,4 +6,12 @@ Deprecation TODO's for post - 0.7x
- remove all pre-0.7x compatibility selectors for: - remove all pre-0.7x compatibility selectors for:
.post-content .post-content
.topic-title .topic-title
.post_reply .post_reply
.edit
.delete
.purge
.move
.reply
.quote
.chat
.flag

@ -164,17 +164,19 @@ define('forum/topic/posts', [
} }
function toggleModTools(pid, privileges) { function toggleModTools(pid, privileges) {
var postEl = components.get('post', 'pid', pid); var postEl = components.get('post', 'pid', pid),
isSelfPost = parseInt(postEl.attr('data-uid'), 10) === parseInt(app.user.uid, 10);
if (!privileges.editable) { if (!privileges.editable) {
postEl.find('.edit, .delete, .purge').remove(); postEl.find('.edit, .delete, .purge, [component="post/edit"], [component="post/delete"], [component="post/purge"]').remove();
} }
if (!privileges.move) { if (!privileges.move) {
postEl.find('.move').remove(); postEl.find('.move, [component="post/move"]').remove();
} }
postEl.find('.reply, .quote').toggleClass('hidden', !$('.post_reply, [component="post/reply"]').length); postEl.find('.reply, .quote').toggleClass('hidden', !$('.post_reply, [component="post/reply"]').length);
var isSelfPost = parseInt(postEl.attr('data-uid'), 10) === parseInt(app.user.uid, 10); postEl.find('.chat, .flag, [component="user/chat"], [component="post/flag"]').toggleClass('hidden', isSelfPost || !app.user.uid);
postEl.find('.chat, .flag').toggleClass('hidden', isSelfPost || !app.user.uid);
} }
Posts.loadMorePosts = function(direction) { Posts.loadMorePosts = function(direction) {

Loading…
Cancel
Save