Make WordPress Core

Changeset 7236


Ignore:
Timestamp:
03/11/2008 08:55:57 AM (17 years ago)
Author:
westi
Message:

Bring the bubble back when we have moderated a comment. Fixes #6010 props mdawaffe.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/js/edit-comments.js

    r7200 r7236  
    55    $('li span.comment-count').each( function() {
    66        var a = $(this);
    7         var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
     7        var n = parseInt(a.html(),10);
     8        n = n + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
     9        if ( n < 0 ) { n = 0; }
    810        a.html( n.toString() );
     11        $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    912    });
    1013    $('.post-com-count span.comment-count').each( function() {
     
    1922            t = t - 1;
    2023        }
     24        if ( n < 0 ) { n = 0; }
     25        if ( t < 0 ) { t = 0; }
    2126        if ( t >= 0 ) { a.parent().attr('title', adminCommentsL10n.pending.replace( /%i%/, t.toString() ) ); }
    2227        if ( 0 === t ) { a.parents('strong:first').replaceWith( a.parents('strong:first').html() ); }
     
    2833    $('li span.comment-count').each( function() {
    2934        var a = $(this);
    30         if ( parseInt(a.html(),10) < 1 ) { return; }
    31         // on ?edit-comments.php?comment_status=moderated tab
    32         // or the comment is unapproved
    33         if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') ) {
    34             var n = parseInt(a.html(),10) - 1;
    35             a.html( n.toString() );
    36             ( 0 < n ) ? $('#awaiting-mod').each(function() { $(this).show(); $(this).removeClass('count-0') }) : $('#awaiting-mod').hide();
    37         }
     35        var n = parseInt(a.html(),10);
     36        n = n + ( $('#' + settings.element).is('.unapproved') ? -1 : 1 );
     37        if ( n < 0 ) { n = 0; }
     38        a.html( n.toString() );
     39        $('#awaiting-mod')[ 0 == n ? 'addClass' : 'removeClass' ]('count-0');
    3840    });
    3941    $('.post-com-count span.comment-count').each( function() {
  • trunk/wp-includes/script-loader.php

    r7227 r7236  
    123123                'strong' => __('Strong')
    124124            ) );
    125             $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080304' );
     125            $this->add( 'admin-comments', '/wp-admin/js/edit-comments.js', array('wp-lists'), '20080311' );
    126126            $this->localize( 'admin-comments', 'adminCommentsL10n', array(
    127127                'pending' => __('%i% pending') // must look like: "# blah blah"
Note: See TracChangeset for help on using the changeset viewer.