mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
fix post-bar and post count
This commit is contained in:
@@ -81,7 +81,7 @@ define('forum/topic/events', [
|
|||||||
$('[data-pid="' + data.post.pid + '"] .favouriteCount').html(data.post.reputation).attr('data-favourites', data.post.reputation);
|
$('[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) {
|
if (ajaxify.data.category && ajaxify.data.category.slug) {
|
||||||
ajaxify.go('category/' + ajaxify.data.category.slug, null, true);
|
ajaxify.go('category/' + ajaxify.data.category.slug, null, true);
|
||||||
}
|
}
|
||||||
@@ -162,6 +162,8 @@ define('forum/topic/events', [
|
|||||||
function onPostPurged(pid) {
|
function onPostPurged(pid) {
|
||||||
components.get('post', 'pid', pid).fadeOut(500, function() {
|
components.get('post', 'pid', pid).fadeOut(500, function() {
|
||||||
$(this).remove();
|
$(this).remove();
|
||||||
|
ajaxify.data.postcount --;
|
||||||
|
postTools.updatePostCount(ajaxify.data.postcount);
|
||||||
posts.showBottomPostBar();
|
posts.showBottomPostBar();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -230,8 +230,11 @@ define('forum/topic/posts', [
|
|||||||
|
|
||||||
Posts.showBottomPostBar = function() {
|
Posts.showBottomPostBar = function() {
|
||||||
var mainPost = components.get('post', 'index', 0);
|
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);
|
$('.post-bar').clone().appendTo(mainPost);
|
||||||
|
} else if (mainPost.length && posts.length < 2) {
|
||||||
|
mainPost.find('.post-bar').remove();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user