Make WordPress Core

Ticket #32395: 32395.4.diff

File 32395.4.diff, 6.2 KB (added by helen, 10 years ago)
  • src/wp-admin/css/list-tables.css

     
    427427        content: '\f140';
    428428}
    429429
     430.wp-list-table .toggle-row {
     431        position: absolute;
     432        right: 8px;
     433        top: 10px;
     434        display: none;
     435        padding: 0;
     436        width: 40px;
     437        height: 40px;
     438        border: none;
     439        outline: none;
     440        background: transparent;
     441}
     442
     443.wp-list-table .toggle-row:hover {
     444        cursor: pointer;
     445}
     446
     447.wp-list-table .toggle-row:focus {
     448    -webkit-box-shadow:
     449        0 0 0 1px #5b9dd9,
     450                0 0 2px 1px rgba(30, 140, 190, .8);
     451    box-shadow:
     452        0 0 0 1px #5b9dd9,
     453                0 0 2px 1px rgba(30, 140, 190, .8);
     454}
     455
     456.ie8 .wp-list-table .toggle-row:focus {
     457        outline: #5b9dd9 solid 1px;
     458}
     459
     460.wp-list-table .toggle-row:active {
     461        -webkit-box-shadow: none;
     462        box-shadow: none;
     463}
     464
     465.wp-list-table .toggle-row:before {
     466        position: absolute;
     467        top: 0;
     468        left: 10px;
     469        display: block;
     470        padding: 0;
     471        color: #666;
     472        content: '\f140';
     473        font: normal 20px/1 'dashicons';
     474        line-height: 10px;
     475        -webkit-font-smoothing: antialiased;
     476        -moz-osx-font-smoothing: grayscale;
     477        speak: none;
     478}
     479
     480.wp-list-table .is-expanded .toggle-row:before {
     481        content: '\f142';
     482}
     483
    430484tr.wp-locked .locked-indicator {
    431485        margin-left: 6px;
    432486        height: 20px;
     
    16471701                font-size: 14px;
    16481702        }
    16491703
    1650         /* Columns to hide */
    1651         .fixed .column-date,
    1652         .fixed .column-author,
    1653         .column-categories,
    1654         .column-tags,
    1655         .tags .column-description,
    1656         .media .column-parent,
    1657         .media .column-comments,
    1658         .users .column-email,
    1659         .users .column-name,
    1660         .sites .column-registered,
    1661         .sites .column-users {
     1704        .wp-list-table th:not(.column-primary),
     1705        .wp-list-table th:not(.column-primary),
     1706        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
    16621707                display: none;
    16631708        }
    16641709
    1665         .fixed .column-comment .comment-author {
     1710        /* Checkboxes need to show */
     1711        .wp-list-table th.check-column {
     1712                display: table-cell;
     1713                width: 35px;
     1714        }
     1715
     1716        .wp-list-table .toggle-row {
    16661717                display: block;
    16671718        }
    16681719
    1669         /* Posts */
    1670         .column-title {
    1671                 width: 85%;
     1720        .wp-list-table tr:not(.inline-edit-row) td {
     1721                position: relative;
     1722                clear: both;
     1723                display: block;
     1724                width: auto !important; /* needs to override some columns that are more specifically targeted */
    16721725        }
    16731726
    1674         .fixed .column-comments, .widefat .check-column {
    1675                 width: 35px
     1727        .wp-list-table td.column-primary {
     1728                padding-right: 50px; /* space for toggle button */
    16761729        }
    16771730
     1731        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
     1732                padding: 3px 8px 3px 35% !important; /* space for the label */
     1733        }
     1734
     1735        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary)::before {
     1736                position: absolute;
     1737                left: 10px; /* match padding of regular table cell */
     1738                display: block;
     1739                overflow: hidden;
     1740                width: 32%; /* leave a little space for a gutter */
     1741                content: attr(data-colname);
     1742                white-space: nowrap;
     1743                text-overflow: ellipsis;
     1744        }
     1745
     1746        .wp-list-table .is-expanded td:not(.hidden) {
     1747                display: block !important;
     1748        }
     1749
     1750        .fixed .column-comment .comment-author {
     1751                display: block;
     1752        }
     1753
    16781754        .widefat thead .check-column, .widefat tfoot .check-column {
    16791755                padding: 10px 0 10px;
    16801756        }
  • src/wp-admin/includes/class-wp-list-table.php

     
    497497                }
    498498                $out .= '</div>';
    499499
     500                $out .= '<button type="button" class="toggle-row"><span class="screen-reader-text">Show more details</span></button>';
     501
    500502                return $out;
    501503        }
    502504
     
    921923         * @param bool $with_id Whether to set the id attribute or not
    922924         */
    923925        public function print_column_headers( $with_id = true ) {
    924                 list( $columns, $hidden, $sortable ) = $this->get_column_info();
     926                list( $columns, $hidden, $sortable, $primary ) = $this->get_column_info();
    925927
    926928                $current_url = set_url_scheme( 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
    927929                $current_url = remove_query_arg( 'paged', $current_url );
     
    955957                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
    956958                                $class[] = 'num';
    957959
     960                        if ( $column_key === $primary ) {
     961                                $class[] = 'column-primary';
     962                        }
     963
    958964                        if ( isset( $sortable[$column_key] ) ) {
    959965                                list( $orderby, $desc_first ) = $sortable[$column_key];
    960966
  • src/wp-admin/includes/class-wp-posts-list-table.php

     
    973973                                $classes .= ' hidden';
    974974                        }
    975975
    976                         $attributes = "class='$classes'";
     976                        // Comments is a special case, as its column display name contains HTML
     977                        if ( 'comments' === $column_name ) {
     978                                $data = 'data-colname="' . esc_attr__( 'Comments' ) . '"';
     979                        } else {
     980                                $data = 'data-colname="' . esc_attr( $column_display_name ) . '"';
     981                        }
    977982
     983                        $attributes = "class='$classes' $data";
     984
    978985                        if ( 'cb' === $column_name ) {
    979986                                echo '<th scope="row" class="check-column">';
    980987
  • src/wp-admin/js/common.js

     
    482482                }
    483483        }, 'td.has-row-actions' );
    484484
     485        // Toggle list table rows on small screens
     486        $( 'tbody' ).on( 'click', '.toggle-row', function() {
     487                $( this ).closest( 'tr' ).toggleClass( 'is-expanded' );
     488        });
     489
    485490        $('#default-password-nag-no').click( function() {
    486491                setUserSetting('default_password_nag', 'hide');
    487492                $('div.default-password-nag').hide();
  • src/wp-admin/js/inline-edit-post.js

     
    133133                editRow = $('#inline-edit').clone(true);
    134134                $('td', editRow).attr('colspan', $('.widefat:first thead th:visible').length);
    135135
    136                 $(t.what+id).hide().after(editRow).after('<tr class="hidden"></tr>');
     136                $(t.what+id).removeClass('is-expanded').hide().after(editRow).after('<tr class="hidden"></tr>');
    137137
    138138                // populate the data
    139139                rowData = $('#inline_'+id);