Update comment count in single post row on post comment screen, edit.php?p=1&c=1.

git-svn-id: http://svn.automattic.com/wordpress/trunk@6550 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
matt
2008-01-04 11:53:15 +00:00
parent 2ad5f03b1c
commit f05fe26e0c
2 changed files with 9 additions and 3 deletions

View File

@@ -3,15 +3,21 @@ jQuery(function($) {
var dimAfter = function( r, settings ) {
$('.comment-count').each( function() {
var a = $('#' + this.id );
var a = $(this);
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
a.html( n.toString() );
});
// we need to do the opposite for this guy, TODO: update title
$('.post-com-count').each( function() {
var a = $(this);
var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? -1 : 1 );
a.html( n.toString() );
});
}
var delAfter = function( r, settings ) {
$('.comment-count').each( function() {
var a = $('#' + this.id );
var a = $(this);
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() );