Don't increment moderation counter when deleting or marking comments as spam. fixes #6338

git-svn-id: https://develop.svn.wordpress.org/trunk@7459 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Mark Jaquith 2008-03-21 20:29:03 +00:00
parent 933afe995a
commit 909039479f
1 changed files with 4 additions and 2 deletions

View File

@ -33,14 +33,16 @@ var delAfter = function( r, settings ) {
$('li span.comment-count').each( function() {
var a = $(this);
var n = parseInt(a.html(),10);
n = n + ( $('#' + settings.element).is('.unapproved') ? -1 : 1 );
if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
n = n - 1;
}
if ( n < 0 ) { n = 0; }
a.html( n.toString() );
$('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
});
$('.post-com-count span.comment-count').each( function() {
var a = $(this);
if ( $('#' + settings.element).is('.unapproved') ) { // we deleted an unapproved comment, decrement pending title
if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
var t = parseInt(a.parent().attr('title'), 10);
if ( t < 1 ) { return; }
t = t - 1;