Make WordPress Core

Ticket #32395: 32395.diff

File 32395.diff, 6.5 KB (added by helen, 8 years ago)
  • src/wp-admin/css/forms.css

     
    949949        }
    950950
    951951        .widefat th input[type="checkbox"] {
     952                margin-bottom: 2px;
     953        }
     954
     955        .widefat thead input[type="checkbox"] {
    952956                margin-bottom: 8px;
    953957        }
    954958
  • src/wp-admin/css/list-tables.css

     
    423423        content: '\f140';
    424424}
    425425
     426.wp-list-table .toggle-row {
     427        position: relative;
     428        display: none;
     429        margin-left: 8px; /* match the checkbox */
     430        padding: 0;
     431        width: 25px; /* match the checkbox */
     432        height: 20px;
     433        border: none;
     434        background: transparent;
     435}
     436
     437.wp-list-table .toggle-row:hover {
     438        cursor: pointer;
     439}
     440
     441.wp-list-table .toggle-row:focus {
     442        color: #124964;
     443    -webkit-box-shadow:
     444        0 0 0 1px #5b9dd9,
     445                0 0 2px 1px rgba(30, 140, 190, .8);
     446    box-shadow:
     447        0 0 0 1px #5b9dd9,
     448                0 0 2px 1px rgba(30, 140, 190, .8);
     449}
     450
     451.ie8 .wp-list-table .toggle-row:focus {
     452        outline: #5b9dd9 solid 1px;
     453}
     454
     455.wp-list-table .toggle-row:before {
     456        position: absolute;
     457        top: 0;
     458        left: -3px;
     459        display: block;
     460        padding: 0;
     461        color: #666;
     462        content: '\f140';
     463        font: normal 30px/1 'dashicons';
     464        line-height: 10px;
     465        -webkit-font-smoothing: antialiased;
     466        -moz-osx-font-smoothing: grayscale;
     467        speak: none;
     468}
     469
     470.wp-list-table .is-expanded .toggle-row:before {
     471        content: '\f142';
     472}
     473
    426474tr.wp-locked .locked-indicator {
    427475        margin-left: 6px;
    428476        height: 20px;
     
    16351683                font-size: 14px;
    16361684        }
    16371685
    1638         /* Columns to hide */
    1639         .fixed .column-date,
    1640         .fixed .column-author,
    1641         .column-categories,
    1642         .column-tags,
    1643         .tags .column-description,
    1644         .media .column-parent,
    1645         .media .column-comments,
    1646         .users .column-email,
    1647         .users .column-name,
    1648         .sites .column-registered,
    1649         .sites .column-users {
     1686        .wp-list-table th:not(.column-primary),
     1687        .wp-list-table th:not(.column-primary),
     1688        .wp-list-table td:not(.column-primary) {
    16501689                display: none;
    16511690        }
    16521691
    1653         .fixed .column-comment .comment-author {
     1692        /* Checkboxes need to show */
     1693        .wp-list-table th.check-column {
     1694                display: table-cell;
     1695                width: 35px;
     1696        }
     1697
     1698        .wp-list-table .toggle-row {
    16541699                display: block;
    16551700        }
    16561701
    1657         /* Posts */
    1658         .column-title {
    1659                 width: 85%;
     1702        .wp-list-table td {
     1703                position: relative;
     1704                clear: both;
     1705                display: block;
     1706                width: auto !important; /* needs to override some columns that are more specifically targeted */
    16601707        }
    16611708
    1662         .fixed .column-comments, .widefat .check-column {
    1663                 width: 35px
     1709        .wp-list-table td:not(.column-primary) {
     1710                padding: 3px 8px 3px 35% !important; /* space for the label */
    16641711        }
    16651712
     1713        .wp-list-table td:not(.column-primary)::before {
     1714                position: absolute;
     1715                left: 10px; /* match padding of regular table cell */
     1716                display: block;
     1717                overflow: hidden;
     1718                width: 32%; /* leave a little space for a gutter */
     1719                content: attr(data-colname);
     1720                white-space: nowrap;
     1721                text-overflow: ellipsis;
     1722        }
     1723
     1724        .wp-list-table .is-expanded td {
     1725                display: block;
     1726        }
     1727
     1728        .fixed .column-comment .comment-author {
     1729                display: block;
     1730        }
     1731
    16661732        .widefat thead .check-column, .widefat tfoot .check-column {
    16671733                padding: 10px 0 10px;
    16681734        }
     
    18981964        }
    18991965
    19001966        .widefat tbody th.check-column input[type="checkbox"] {
    1901                 margin-top: -3px;
     1967                margin-top: -4px;
    19021968                margin-left: 8px;
    19031969        }
    19041970
  • src/wp-admin/includes/class-wp-list-table.php

     
    912912         * @param bool $with_id Whether to set the id attribute or not
    913913         */
    914914        public function print_column_headers( $with_id = true ) {
    915                 list( $columns, $hidden, $sortable ) = $this->get_column_info();
     915                list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
    916916
    917917                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    918918                $current_url = remove_query_arg( 'paged', $current_url );
     
    948948                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
    949949                                $class[] = 'num';
    950950
     951                        if ( $column_key === $primary ) {
     952                                $class[] = 'column-primary';
     953                        }
     954
    951955                        if ( isset( $sortable[$column_key] ) ) {
    952956                                list( $orderby, $desc_first ) = $sortable[$column_key];
    953957
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    723723                                $style = ' style="display:none;"';
    724724                        }
    725725
    726                         $attributes = "class='$classes'$style";
     726                        // Comments is a special case, as its column display name contains HTML
     727                        if ( 'comments' === $column_name ) {
     728                                $data = ' data-colname="' . esc_attr__( 'Comments asadfkj this is a longer string' ) . '"';
     729                        } else {
     730                                $data = ' data-colname="' . esc_attr( $column_display_name ) . '"';
     731                        }
    727732
     733                        $attributes = "class='$classes'$style$data";
     734
    728735                        switch ( $column_name ) {
    729736
    730737                        case 'cb':
     
    737744                                <label class="screen-reader-text" for="cb-select-<?php the_ID(); ?>"><?php printf( __( 'Select %s' ), $title ); ?></label>
    738745                                <input id="cb-select-<?php the_ID(); ?>" type="checkbox" name="post[]" value="<?php the_ID(); ?>" />
    739746                                <div class="locked-indicator"></div>
     747                                <button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>
    740748                                <?php
    741749                                }
    742750                                ?>
     
    746754
    747755                        case 'title':
    748756                                $classes .= ' page-title'; // Special addition for title column
    749                                 $attributes = "class='$classes'$style";
     757                                $attributes = "class='$classes'$style$data";
    750758                                if ( $this->hierarchical_display ) {
    751759                                        if ( 0 == $level && (int) $post->post_parent > 0 ) {
    752760                                                // Sent level 0 by accident, by default, or because we don't know the actual level.
  • src/wp-admin/js/common.js

     
    480480                }
    481481        }, 'td.has-row-actions' );
    482482
     483        // Toggle list table rows on small screens
     484        $( 'tbody' ).on( 'click', '.toggle-row', function() {
     485                $( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
     486        });
     487
    483488        $('#default-password-nag-no').click( function() {
    484489                setUserSetting('default_password_nag', 'hide');
    485490                $('div.default-password-nag').hide();