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.

Built from https://develop.svn.wordpress.org/trunk@33692


git-svn-id: http://core.svn.wordpress.org/trunk@33659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-21 17:26:26 +00:00
parent 54b2e39fdd
commit fa2d0a2d55
8 changed files with 29 additions and 7 deletions

View File

@ -117,6 +117,11 @@
text-align: center;
}
.column-response .post-com-count-no-pending,
.column-comments .post-com-count-no-pending {
display: none;
}
/* comments */
.commentlist li {

View File

@ -117,6 +117,11 @@
text-align: center;
}
.column-response .post-com-count-no-pending,
.column-comments .post-com-count-no-pending {
display: none;
}
/* comments */
.commentlist li {

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -649,7 +649,7 @@ class WP_List_Table {
$pending_phrase
);
} else {
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>',
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>',
$pending_comments_number,
$approved_comments ? __( 'No pending comments' ) : __( 'No comments' )
);

View File

@ -138,12 +138,12 @@ setCommentsList = function() {
updatePending = function( diff, commentPostId ) {
var postSelector = '.post-com-count-' + commentPostId,
noClass = 'comment-count-no-pending',
noParentClass = 'post-com-count-no-pending',
pendingClass = 'comment-count-pending',
counts = $( 'span.pending-count' ),
pending,
noPending;
counts.each(function() {
$( 'span.pending-count' ).each(function() {
var a = $(this), n = getCount(a) + diff;
if ( n < 1 )
n = 0;
@ -165,7 +165,11 @@ setCommentsList = function() {
n = 0;
if ( 0 === n ) {
a.parent().addClass( noParentClass );
a.removeClass( pendingClass ).addClass( noClass );
} else {
a.parent().removeClass( noParentClass );
a.addClass( pendingClass ).removeClass( noClass );
}
updateCount( a, n );
});
@ -173,7 +177,11 @@ setCommentsList = function() {
noPending.each(function() {
var a = $(this);
if ( diff > 0 ) {
a.parent().removeClass( noParentClass );
a.removeClass( noClass ).addClass( pendingClass );
} else {
a.parent().addClass( noParentClass );
a.addClass( noClass ).removeClass( pendingClass );
}
updateCount( a, diff );
});
@ -203,6 +211,8 @@ setCommentsList = function() {
if ( 0 === n ) {
a.removeClass( approvedClass ).addClass( noClass );
} else {
a.addClass( approvedClass ).removeClass( noClass );
}
updateCount( a, n );
});
@ -211,6 +221,8 @@ setCommentsList = function() {
var a = $(this);
if ( diff > 0 ) {
a.removeClass( noClass ).addClass( approvedClass );
} else {
a.addClass( noClass ).removeClass( approvedClass );
}
updateCount( a, diff );
});

File diff suppressed because one or more lines are too long

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '4.4-alpha-33691';
$wp_version = '4.4-alpha-33692';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.