Make WordPress Core


Ignore:
Timestamp:
01/14/2015 10:13:03 PM (10 years ago)
Author:
helen
Message:

List tables: Use CSS :nth-child() selectors for zebra striping.

Note that this does not fix issues related to comment quick edit. Internal linking also continues to use the .alternate class for now. IE8 and below gracefully degrade by not having zebra striping.

There is some hoop jumping with adding an extra table row to maintain zebra striping during quick edit. Documenting that here for future reference; it is also in the inline documentation.

fixes #30981 and #26060. see #25060.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-ms-sites-list-table.php

    r30679 r31181  
    209209        }
    210210
    211         $class = '';
    212211        foreach ( $this->items as $blog ) {
    213             $class = ( 'alternate' == $class ) ? '' : 'alternate';
     212            $class = '';
    214213            reset( $status_list );
    215214
     
    217216            foreach ( $status_list as $status => $col ) {
    218217                if ( get_blog_status( $blog['blog_id'], $status ) == 1 ) {
    219                     $class = $col[0];
     218                    $class = " class='{$col[0]}'";
    220219                    $blog_states[] = $col[1];
    221220                }
     
    232231                }
    233232            }
    234             echo "<tr class='$class'>";
     233            echo "<tr{$class}>";
    235234
    236235            $blogname = ( is_subdomain_install() ) ? str_replace( '.' . get_current_site()->domain, '', $blog['domain'] ) : $blog['path'];
Note: See TracChangeset for help on using the changeset viewer.