Changeset 27759
- Timestamp:
- 03/26/2014 11:13:43 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/edit-comments.js
r27131 r27759 3 3 4 4 (function($) { 5 var getCount, updateCount, updatePending , dashboardTotals;5 var getCount, updateCount, updatePending; 6 6 7 7 setCommentsList = function() { … … 80 80 a.attr('data-wp-lists', 'delete:the-comment-list:comment-' + id + '::un' + action + '=1'); 81 81 a.attr('class', 'vim-z vim-destructive'); 82 $('.avatar', el). clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside');82 $('.avatar', el).first().clone().prependTo('#undo-' + id + ' .' + action + '-undo-inside'); 83 83 84 84 a.click(function(){ … … 104 104 105 105 totalInput.val( total.toString() ); 106 };107 108 dashboardTotals = function(n) {109 var total, appr, totalN, apprN,110 dash = $('#dashboard_right_now');111 112 n = n || 0;113 if ( isNaN(n) || !dash.length )114 return;115 116 total = $('span.total-count', dash);117 appr = $('span.approved-count', dash);118 totalN = getCount(total);119 120 totalN = totalN + n;121 apprN = totalN - getCount( $('span.pending-count', dash) ) - getCount( $('span.spam-count', dash) );122 updateCount(total, totalN);123 updateCount(appr, apprN);124 106 }; 125 107 … … 154 136 updateCount( a, n ); 155 137 }); 156 157 dashboardTotals();158 138 }; 159 139 160 140 // In admin-ajax.php, we send back the unix time stamp instead of 1 on success 161 141 delAfter = function( r, settings ) { 162 var total_items_i18n, total, N,spam, trash, pending,142 var total_items_i18n, total, spam, trash, pending, 163 143 untrash = $(settings.target).parent().is('span.untrash'), 164 144 unspam = $(settings.target).parent().is('span.unspam'), … … 206 186 }); 207 187 208 if ( $('#dashboard_right_now').length ) { 209 N = trash ? -1 * trash : 0; 210 dashboardTotals(N); 211 } else { 188 if ( ! $('#dashboard_right_now').length ) { 212 189 total = totalInput.val() ? parseInt( totalInput.val(), 10 ) : 0; 213 190 if ( $(settings.target).parent().is('span.undo') ) -
trunk/src/wp-includes/js/wp-lists.js
r26195 r27759 310 310 311 311 add: function( e, s ) { 312 e = $( $.trim(e) ); // Trim leading whitespaces 312 if ( 'string' == typeof e ) { 313 e = $( $.trim( e ) ); // Trim leading whitespaces 314 } else { 315 e = $( e ); 316 } 313 317 314 318 var list = $(this), old = false, _s = { pos: 0, id: 0, oldId: null }, ba, ref, color;
Note: See TracChangeset
for help on using the changeset viewer.