Ticket #6338: 6338.diff

File 6338.diff, 1020 bytes (added by mdawaffe, 5 years ago)
Line 
1Index: wp-includes/js/wp-lists.js
2===================================================================
3--- wp-includes/js/wp-lists.js  (revision 7461)
4+++ wp-includes/js/wp-lists.js  (working copy)
5@@ -36,7 +36,8 @@
6                var bg; var r;
7                s = $.extend( {}, this.wpList.settings, {
8                        element: null,
9-                       nonce: 0
10+                       nonce: 0,
11+                       target: e.get(0)
12                }, s || {} );
13                if ( $.isFunction( s.confirm ) ) {
14                        if ( 'add' != a ) {
15Index: wp-admin/js/edit-comments.js
16===================================================================
17--- wp-admin/js/edit-comments.js        (revision 7461)
18+++ wp-admin/js/edit-comments.js        (working copy)
19@@ -35,6 +35,8 @@
20                var n = parseInt(a.html(),10);
21                if ( $('#' + settings.element).is('.unapproved') ) { // we deleted a formerly unapproved comment
22                        n = n - 1;
23+               } else if ( $(settings.target).parents( 'span.unapprove' ).size() ) { // we "deleted" an approved comment from the approved list by clicking "Unapprove"
24+                       n = n + 1;
25                }
26                if ( n < 0 ) { n = 0; }
27                a.html( n.toString() );