Make WordPress Core

Changeset 17202


Ignore:
Timestamp:
01/01/2011 11:19:26 PM (14 years ago)
Author:
nacin
Message:

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

Location:
trunk/wp-admin
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/css/colors-classic.dev.css

    r17190 r17202  
    14011401
    14021402.tablenav .tablenav-pages a {
    1403     border-color: #D1E5EE;
     1403    border-color: #d1e5ee;
    14041404    background: #eee url('../images/menu-bits-vs.gif?ver=20101102') repeat-x scroll left -379px;
    14051405}
    14061406
    1407 .tablenav .tablenav-pages a:hover {
     1407.tablenav .tablenav-pages a:hover,
     1408.tablenav .tablenav-pages a:focus {
    14081409    color: #d54e21;
    1409     border-color: #d54321;
    1410 }
    1411 
    1412 .tablenav .tablenav-pages a:active {
    1413     color: #fff !important;
     1410}
     1411
     1412.tablenav .tablenav-pages a.disabled,
     1413.tablenav .tablenav-pages a.disabled:hover,
     1414.tablenav .tablenav-pages a.disabled:focus {
     1415    color: #aaa;
    14141416}
    14151417
  • trunk/wp-admin/css/colors-fresh.dev.css

    r17176 r17202  
    14001400}
    14011401
    1402 .tablenav .tablenav-pages a:hover {
     1402.tablenav .tablenav-pages a:hover,
     1403.tablenav .tablenav-pages a:focus {
    14031404    color: #d54e21;
    1404     border-color: #d54321;
    1405 }
    1406 
    1407 .tablenav .tablenav-pages a:active {
    1408     color: #fff !important;
     1405}
     1406
     1407.tablenav .tablenav-pages a.disabled,
     1408.tablenav .tablenav-pages a.disabled:hover,
     1409.tablenav .tablenav-pages a.disabled:focus {
     1410    color: #aaa;
    14091411}
    14101412
  • trunk/wp-admin/css/wp-admin.dev.css

    r17191 r17202  
    14941494}
    14951495
     1496.tablenav .tablenav-pages a.disabled:hover {
     1497    cursor: default;
     1498}
     1499
     1500.tablenav .tablenav-pages a.disabled:active {
     1501    cursor: default;
     1502}
     1503
    14961504.tablenav .displaying-num {
    14971505    margin-right: 10px;
  • trunk/wp-admin/includes/class-wp-list-table.php

    r17156 r17202  
    481481        $page_links = array();
    482482
     483        $disable_first = $disable_last = '';
     484        if ( $current == 1 )
     485            $disable_first = ' disabled';
     486        if ( $current == $total_items )
     487            $disable_last = ' disabled';
     488
    483489        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    484             'first-page',
     490            'first-page' . $disable_first,
    485491            esc_attr__( 'Go to the first page' ),
    486492            esc_url( remove_query_arg( 'paged', $current_url ) ),
     
    489495
    490496        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    491             'prev-page',
     497            'prev-page' . $disable_first,
    492498            esc_attr__( 'Go to the previous page' ),
    493499            esc_url( add_query_arg( 'paged', max( 1, $current-1 ), $current_url ) ),
     
    505511
    506512        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    507             'next-page',
     513            'next-page' . $disable_last,
    508514            esc_attr__( 'Go to the next page' ),
    509515            esc_url( add_query_arg( 'paged', min( $total_pages, $current+1 ), $current_url ) ),
     
    512518
    513519        $page_links[] = sprintf( "<a class='%s' title='%s' href='%s'>%s</a>",
    514             'last-page',
     520            'last-page' . $disable_last,
    515521            esc_attr__( 'Go to the last page' ),
    516522            esc_url( add_query_arg( 'paged', $total_pages, $current_url ) ),
  • trunk/wp-admin/js/list-table.dev.js

    r17156 r17202  
    9292            this.handle_error();
    9393        } else {
     94            var tablenav = $('.tablenav-pages');
     95
    9496            this.stop_loading();
    9597
     
    104106
    105107            if ( response.total_pages > 1 )
    106                 $('.tablenav-pages').removeClass('one-page');
     108                tablenav.removeClass('one-page');
    107109
    108110            $('.current-page').val($.query.GET('paged'));
     111
     112            // Disable buttons that should noop.
     113            tablenav.find('.first-page, .prev-page').toggleClass('disabled', 1 == $.query.GET('paged'));
     114            tablenav.find('.next-page, .last-page').toggleClass('disabled', response.total_pages_i18n == $.query.GET('paged'));
    109115
    110116            $('th.column-cb :input').attr('checked', false);
Note: See TracChangeset for help on using the changeset viewer.