WordPress.org

Make WordPress Core

Changeset 6550


Ignore:
Timestamp:
01/04/2008 11:53:15 AM (10 years ago)
Author:
matt
Message:

Update comment count in single post row on post comment screen, edit.php?p=1&c=1.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-post-rows.php

    r6272 r6550  
    6767        if ( $left )
    6868            echo '<strong>';
    69         comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase'>" . __('%') . '</a>');
     69        comments_number("<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('0') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('1') . '</a>', "<a href='edit.php?p=$id&amp;c=1' title='$pending_phrase' class='post-com-count'>" . __('%') . '</a>');
    7070        if ( $left )
    7171            echo '</strong>';
  • trunk/wp-admin/js/edit-comments.js

    r6545 r6550  
    44var dimAfter = function( r, settings ) {
    55    $('.comment-count').each( function() {
    6         var a = $('#' + this.id );
     6        var a = $(this);
    77        var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? 1 : -1 );
     8        a.html( n.toString() );
     9    });
     10    // we need to do the opposite for this guy, TODO: update title
     11    $('.post-com-count').each( function() {
     12        var a = $(this);
     13        var n = parseInt(a.html(),10) + ( $('#' + settings.element).is('.' + settings.dimClass) ? -1 : 1 );
    814        a.html( n.toString() );
    915    });
     
    1218var delAfter = function( r, settings ) {
    1319    $('.comment-count').each( function() {
    14         var a = $('#' + this.id );
     20        var a = $(this);
    1521        if ( a.parent('.current').size() || $('#' + settings.element).is('.unapproved') && parseInt(a.html(),10) > 0 ) {
    1622            var n = parseInt(a.html(),10) - 1;
Note: See TracChangeset for help on using the changeset viewer.