Update both of the comment counts when something changes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6545 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt
2008-01-03 22:24:58 +00:00
parent 2073c22bbd
commit 594820e5b0
2 changed files with 14 additions and 10 deletions

View File

@@ -2,17 +2,21 @@ var list; var extra;
jQuery(function($) {
var dimAfter = function( r, settings ) {
var a = $('#awaitmod');
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
a.html( n.toString() );
$('.comment-count').each( function() {
var a = $('#' + this.id );
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
a.html( n.toString() );
});
}
var delAfter = function( r, settings ) {
var a = $('#awaitmod');
if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
var n = parseInt(a.html(),10) - 1;
a.html( n.toString() );
}
$('.comment-count').each( function() {
var a = $('#' + this.id );
if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
var n = parseInt(a.html(),10) - 1;
a.html( n.toString() );
}
});
if ( extra.size() == 0 || extra.children().size() == 0 ) {
return;