Index: wp-admin/js/edit-comments.dev.js
===================================================================
--- wp-admin/js/edit-comments.dev.js	(revision 19885)
+++ wp-admin/js/edit-comments.dev.js	(working copy)
@@ -27,25 +27,8 @@
 			c.find('div.comment_status').html('1');
 		}
 
-		$('span.pending-count').each( function() {
-			var a = $(this), n, dif;
-
-			n = a.html().replace(/[^0-9]+/g, '');
-			n = parseInt(n, 10);
-
-			if ( isNaN(n) )
-				return;
-
-			dif = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
-			n = n + dif;
-
-			if ( n < 0 )
-				n = 0;
-
-			a.closest('.awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
-			updateCount(a, n);
-			dashboardTotals();
-		});
+		var diff = $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1;
+		updatePending( diff );
 	};
 
 	// Send current total, page, per_page and url
@@ -129,7 +112,6 @@
 		apprN = totalN - getCount( $('span.pending-count', dash) ) - getCount( $('span.spam-count', dash) );
 		updateCount(total, totalN);
 		updateCount(appr, apprN);
-
 	};
 
 	getCount = function(el) {
@@ -154,17 +136,16 @@
 		el.html(n);
 	};
 
-	updatePending = function(n) {
-		$('span.pending-count').each( function() {
-			var a = $(this);
-
-			if ( n < 0 )
+	updatePending = function( diff ) {
+		$('span.pending-count').each(function() {
+			var a = $(this), n = getCount(a) + diff;
+			if ( n < 1 )
 				n = 0;
-
 			a.closest('.awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
-			updateCount(a, n);
-			dashboardTotals();
+			updateCount( a, n );
 		});
+
+		dashboardTotals();
 	};
 
 	// In admin-ajax.php, we send back the unix time stamp instead of 1 on success
@@ -193,12 +174,13 @@
 		else
 			spam = getUpdate('spam');
 
-		pending = getCount( $('span.pending-count').eq(0) );
-
-		if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
-			pending = pending + 1;
-		} else if ( unapproved ) { // we deleted a formerly unapproved comment
-			pending = pending - 1;
+		if ( $(settings.target).parent().is('span.unapprove') || ( ( untrash || unspam ) && unapproved ) ) {
+			// a comment was 'deleted' from another list (e.g. approved, spam, trash) and moved to pending,
+			// or a trash/spam of a pending comment was undone
+			pending = 1;
+		} else if ( unapproved ) {
+			// a pending comment was trashed/spammed/approved
+			pending = -1;
 		}
 
 		updatePending(pending);
