Disabled states for first/prev and next/last pagination buttons when they should noop. see #15503.

git-svn-id: https://develop.svn.wordpress.org/trunk@17202 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin
2011-01-01 23:19:26 +00:00
parent e1ffe72def
commit 4f947ac5b9
5 changed files with 38 additions and 14 deletions
+7 -1
View File
@@ -91,6 +91,8 @@ window.listTable = {
if ( 'object' != typeof response ) {
this.handle_error();
} else {
var tablenav = $('.tablenav-pages');
this.stop_loading();
$('div.updated, div.error').not('.persistent, .inline').remove();
@@ -103,10 +105,14 @@ window.listTable = {
this.set_total_pages(response.total_pages);
if ( response.total_pages > 1 )
$('.tablenav-pages').removeClass('one-page');
tablenav.removeClass('one-page');
$('.current-page').val($.query.GET('paged'));
// Disable buttons that should noop.
tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged'));
tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages_i18n == $.query.GET('paged'));
$('th.column-cb :input').attr('checked', false);
if ( history.replaceState ) {