user/postcount component

v1.18.x
psychobunny 10 years ago
parent 10b9919a49
commit b9dd994a56

@ -22,7 +22,7 @@ define('forum/topic/posts', [
}
for (var i=0; i<data.posts.length; ++i) {
var postcount = $('.user_postcount_' + data.posts[i].uid);
var postcount = components.get('user/postcount', data.posts[i].uid);
postcount.html(parseInt(postcount.html(), 10) + 1);
}

@ -18,6 +18,10 @@ var components = components || {};
'post/anchor': function(index) {
var el = components.core.post('index', index).find('[component="post/anchor"]');
return el.length ? el : $('#post_anchor_' + index); // 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
}
};

Loading…
Cancel
Save