fix post-bar and post count

v1.18.x
barisusakli 9 years ago
parent c194f44791
commit 2a6f411eff

@ -81,7 +81,7 @@ define('forum/topic/events', [
$('[data-pid="' + data.post.pid + '"] .favouriteCount').html(data.post.reputation).attr('data-favourites', data.post.reputation);
}
function onTopicPurged(data) {
function onTopicPurged() {
if (ajaxify.data.category && ajaxify.data.category.slug) {
ajaxify.go('category/' + ajaxify.data.category.slug, null, true);
}
@ -162,6 +162,8 @@ define('forum/topic/events', [
function onPostPurged(pid) {
components.get('post', 'pid', pid).fadeOut(500, function() {
$(this).remove();
ajaxify.data.postcount --;
postTools.updatePostCount(ajaxify.data.postcount);
posts.showBottomPostBar();
});

@ -230,8 +230,11 @@ define('forum/topic/posts', [
Posts.showBottomPostBar = function() {
var mainPost = components.get('post', 'index', 0);
if (!!mainPost.length && $('[component="post"]').length > 1) {
var posts = $('[component="post"]');
if (!!mainPost.length && posts.length > 1 && $('.post-bar').length < 2) {
$('.post-bar').clone().appendTo(mainPost);
} else if (mainPost.length && posts.length < 2) {
mainPost.find('.post-bar').remove();
}
};

Loading…
Cancel
Save