Make WordPress Core

Changeset 33692


Ignore:
Timestamp:
08/21/2015 05:25:06 PM (9 years ago)
Author:
wonderboymusic
Message:

Comment List Tables:

  • Toggle visibility of pending bubble when a comment is dynamically moderated
  • Add a CSS class to the pending bubble to hide it / remove to show it

See #11200.

Location:
trunk/src/wp-admin
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/css/list-tables.css

    r33623 r33692  
    118118}
    119119
     120.column-response .post-com-count-no-pending,
     121.column-comments .post-com-count-no-pending {
     122    display: none;
     123}
     124
    120125/* comments */
    121126
  • trunk/src/wp-admin/includes/class-wp-list-table.php

    r33668 r33692  
    650650            );
    651651        } else {
    652             printf( '<span class="post-com-count post-com-count-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
     652            printf( '<span class="post-com-count post-com-count-pending post-com-count-no-pending"><span class="comment-count comment-count-no-pending" aria-hidden="true">%s</span><span class="screen-reader-text">%s</span></span>',
    653653                $pending_comments_number,
    654654                $approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
  • trunk/src/wp-admin/js/edit-comments.js

    r33663 r33692  
    139139        var postSelector = '.post-com-count-' + commentPostId,
    140140            noClass = 'comment-count-no-pending',
     141            noParentClass = 'post-com-count-no-pending',
    141142            pendingClass = 'comment-count-pending',
    142             counts = $( 'span.pending-count' ),
    143143            pending,
    144144            noPending;
    145145
    146         counts.each(function() {
     146        $( 'span.pending-count' ).each(function() {
    147147            var a = $(this), n = getCount(a) + diff;
    148148            if ( n < 1 )
     
    166166
    167167            if ( 0 === n ) {
     168                a.parent().addClass( noParentClass );
    168169                a.removeClass( pendingClass ).addClass( noClass );
     170            } else {
     171                a.parent().removeClass( noParentClass );
     172                a.addClass( pendingClass ).removeClass( noClass );
    169173            }
    170174            updateCount( a, n );
     
    174178            var a = $(this);
    175179            if ( diff > 0 ) {
     180                a.parent().removeClass( noParentClass );
    176181                a.removeClass( noClass ).addClass( pendingClass );
     182            } else {
     183                a.parent().addClass( noParentClass );
     184                a.addClass( noClass ).removeClass( pendingClass );
    177185            }
    178186            updateCount( a, diff );
     
    204212            if ( 0 === n ) {
    205213                a.removeClass( approvedClass ).addClass( noClass );
     214            } else {
     215                a.addClass( approvedClass ).removeClass( noClass );
    206216            }
    207217            updateCount( a, n );
     
    212222            if ( diff > 0 ) {
    213223                a.removeClass( noClass ).addClass( approvedClass );
     224            } else {
     225                a.addClass( noClass ).removeClass( approvedClass );
    214226            }
    215227            updateCount( a, diff );
Note: See TracChangeset for help on using the changeset viewer.