From d93684e0c182a8be0ce032b1e4b54d4c88389f8a Mon Sep 17 00:00:00 2001 From: markjaquith Date: Fri, 21 Mar 2008 21:57:25 +0000 Subject: [PATCH] increment comment moderation counter when unapproving comment from approved comments screen. props mdawaffe. fixes #6338 git-svn-id: http://svn.automattic.com/wordpress/trunk@7462 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/js/edit-comments.js | 2 ++ wp-includes/js/wp-lists.js | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/wp-admin/js/edit-comments.js b/wp-admin/js/edit-comments.js index c58bbad0f1..f2bf8f82b5 100644 --- a/wp-admin/js/edit-comments.js +++ b/wp-admin/js/edit-comments.js @@ -35,6 +35,8 @@ var delAfter = function( r, settings ) { var n = parseInt(a.html(),10); if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment n = n - 1; + } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove" + n = n + 1; } if ( n < 0 ) { n = 0; } a.html( n.toString() ); diff --git a/wp-includes/js/wp-lists.js b/wp-includes/js/wp-lists.js index e0c5b25a56..f1eed16dbf 100644 --- a/wp-includes/js/wp-lists.js +++ b/wp-includes/js/wp-lists.js @@ -36,7 +36,8 @@ var wpList = { var bg; var r; s = $.extend( {}, this.wpList.settings, { element: null, - nonce: 0 + nonce: 0, + target: e.get(0) }, s || {} ); if ( $.isFunction( s.confirm ) ) { if ( 'add' != a ) {