diff --git a/wp-admin/css/colors-classic.dev.css b/wp-admin/css/colors-classic.dev.css index 681a7a0134..b6863b847e 100644 --- a/wp-admin/css/colors-classic.dev.css +++ b/wp-admin/css/colors-classic.dev.css @@ -1400,17 +1400,19 @@ body.press-this .stuffbox:hover .handlediv, } .tablenav .tablenav-pages a { - border-color: #D1E5EE; + border-color: #d1e5ee; background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px; } -.tablenav .tablenav-pages a:hover { +.tablenav .tablenav-pages a:hover, +.tablenav .tablenav-pages a:focus { color: #d54e21; - border-color: #d54321; } -.tablenav .tablenav-pages a:active { - color: #fff !important; +.tablenav .tablenav-pages a.disabled, +.tablenav .tablenav-pages a.disabled:hover, +.tablenav .tablenav-pages a.disabled:focus { + color: #aaa; } .tablenav .tablenav-pages .current { diff --git a/wp-admin/css/colors-fresh.dev.css b/wp-admin/css/colors-fresh.dev.css index 73242a6726..6325917800 100644 --- a/wp-admin/css/colors-fresh.dev.css +++ b/wp-admin/css/colors-fresh.dev.css @@ -1399,13 +1399,15 @@ fieldset.inline-edit-col-right .inline-edit-col { background: #eee url('../images/menu-bits.gif?ver=20100610') repeat-x scroll left -379px; } -.tablenav .tablenav-pages a:hover { +.tablenav .tablenav-pages a:hover, +.tablenav .tablenav-pages a:focus { color: #d54e21; - border-color: #d54321; } -.tablenav .tablenav-pages a:active { - color: #fff !important; +.tablenav .tablenav-pages a.disabled, +.tablenav .tablenav-pages a.disabled:hover, +.tablenav .tablenav-pages a.disabled:focus { + color: #aaa; } .tablenav .tablenav-pages .current { diff --git a/wp-admin/css/wp-admin.dev.css b/wp-admin/css/wp-admin.dev.css index 07836e47f3..b42e32f541 100644 --- a/wp-admin/css/wp-admin.dev.css +++ b/wp-admin/css/wp-admin.dev.css @@ -1493,6 +1493,14 @@ th.asc:hover span.sorting-indicator { border-radius: 5px; } +.tablenav .tablenav-pages a.disabled:hover { + cursor: default; +} + +.tablenav .tablenav-pages a.disabled:active { + cursor: default; +} + .tablenav .displaying-num { margin-right: 10px; font-size: 12px; diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index a8aaa8ff47..39a18b3ec7 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -480,15 +480,21 @@ class WP_List_Table { $page_links = array(); + $disable_first = $disable_last = ''; + if ( $current == 1 ) + $disable_first = ' disabled'; + if ( $current == $total_items ) + $disable_last = ' disabled'; + $page_links[] = sprintf( "%s", - 'first-page', + 'first-page' . $disable_first, esc_attr__( 'Go to the first page' ), esc_url( remove_query_arg( 'paged', $current_url ) ), '«' ); $page_links[] = sprintf( "%s", - 'prev-page', + 'prev-page' . $disable_first, esc_attr__( 'Go to the previous page' ), esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ), '‹' @@ -504,14 +510,14 @@ class WP_List_Table { $page_links[] = '' . sprintf( _x( '%1$s of %2$s', 'paging' ), $html_current_page, $html_total_pages ) . ''; $page_links[] = sprintf( "%s", - 'next-page', + 'next-page' . $disable_last, esc_attr__( 'Go to the next page' ), esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ), '›' ); $page_links[] = sprintf( "%s", - 'last-page', + 'last-page' . $disable_last, esc_attr__( 'Go to the last page' ), esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ), '»' diff --git a/wp-admin/js/list-table.dev.js b/wp-admin/js/list-table.dev.js index e92f453aa8..7144e4817e 100644 --- a/wp-admin/js/list-table.dev.js +++ b/wp-admin/js/list-table.dev.js @@ -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 ) {