mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-01-04 06:40:44 +01:00
post/votes component, user/reputation component
This commit is contained in:
@@ -69,7 +69,7 @@ define('forum/topic/events', [
|
||||
};
|
||||
|
||||
function updatePostVotesAndUserReputation(data) {
|
||||
var votes = $('[data-pid="' + data.post.pid + '"] .votes'),
|
||||
var votes = components.get('post/votes', data.post.pid),
|
||||
reputationElements = $('.reputation[data-uid="' + data.post.uid + '"]');
|
||||
|
||||
votes.html(data.post.votes).attr('data-votes', data.post.votes);
|
||||
|
||||
@@ -102,7 +102,7 @@ define('forum/topic/postTools', ['composer', 'share', 'navigator'], function(com
|
||||
return toggleVote($(this), '.downvoted', 'posts.downvote');
|
||||
});
|
||||
|
||||
postContainer.on('click', '.votes, [component="post/voters"]', function() {
|
||||
postContainer.on('click', '.votes, [component="post/votes"]', function() {
|
||||
showVotes(getData($(this), 'data-pid'));
|
||||
});
|
||||
|
||||
|
||||
@@ -19,9 +19,17 @@ var components = components || {};
|
||||
var el = components.core.post('index', index).find('[component="post/anchor"]');
|
||||
return el.length ? el : $('#post_anchor_' + index); // deprecated after 0.7x
|
||||
},
|
||||
'post/votes': function(pid) {
|
||||
var el = components.core.post('pid', pid).find('[component="post/votes"]');
|
||||
return el.length ? el : components.core.post('pid', pid).find('.votes'); // deprecated after 0.7x
|
||||
},
|
||||
'user/postcount': function(uid) {
|
||||
var el = $('[component="user/postcount"][data-uid="' + uid + '"]');
|
||||
return el.length ? el : $('.user_postcount_' + uid); // deprecated after 0.7x
|
||||
},
|
||||
'user/reputation': function(uid) {
|
||||
var el = $('[component="user/reputation"][data-uid="' + uid + '"]');
|
||||
return el.length ? el : $('.reputation[data-uid="' + uid + '"]'); // deprecated after 0.7x
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user