Comments List Table:

* In a view that initially has comments, but they get removed due to user actions: show the `No Items` row instead of bombing out and showing nothing (which looks broken)
* To accomplish this, in `WP_Comments_List_Table::display()`: call `->display_rows_or_placeholder()` instead of `->display()`
* Listen for the end of row `.fadeOut()`s if necessary using jQuery Promises

Fixes #11200.

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


git-svn-id: http://core.svn.wordpress.org/trunk@33624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Scott Taylor 2015-08-20 05:54:25 +00:00
parent 657d0f6918
commit 2e2223ae74
4 changed files with 21 additions and 5 deletions

View File

@ -409,7 +409,10 @@ class WP_Comments_List_Table extends WP_List_Table {
</tbody>
<tbody id="the-extra-comment-list" data-wp-lists="list:comment" style="display: none;">
<?php $this->items = $this->extra_items; $this->display_rows(); ?>
<?php
$this->items = $this->extra_items;
$this->display_rows_or_placeholder();
?>
</tbody>
<tfoot>

View File

@ -152,7 +152,7 @@ setCommentsList = function() {
// In admin-ajax.php, we send back the unix time stamp instead of 1 on success
delAfter = function( r, settings ) {
var total_items_i18n, total,
var total_items_i18n, total, animated, animatedCallback,
response = true === settings.parsed ? {} : settings.parsed.responses[0],
commentStatus = true === settings.parsed ? '' : response.supplemental.status,
@ -333,9 +333,22 @@ setCommentsList = function() {
return;
}
theList.get(0).wpList.add( theExtraList.children(':eq(0)').remove().clone() );
theList.get(0).wpList.add( theExtraList.children( ':eq(0):not(.no-items)' ).remove().clone() );
refillTheExtraList();
animated = $( ':animated' );
animatedCallback = function () {
if ( ! $( '#the-comment-list tr:visible' ).length ) {
theList.get(0).wpList.add( theExtraList.find( '.no-items' ).clone() );
}
};
if ( animated.length ) {
animated.promise().done( animatedCallback );
} else {
animatedCallback();
}
};
refillTheExtraList = function(ev) {

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-33656';
$wp_version = '4.4-alpha-33657';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.