Make WordPress Core

Ticket #32395: 32395.3.diff

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

     
    423423        content: '\f140';
    424424}
    425425
     426.wp-list-table .toggle-row {
     427        position: absolute;
     428        right: 8px;
     429        top: 10px;
     430        display: none;
     431        padding: 0;
     432        width: 40px;
     433        height: 40px;
     434        border: none;
     435        outline: none;
     436        background: transparent;
     437}
     438
     439.wp-list-table .toggle-row:hover {
     440        cursor: pointer;
     441}
     442
     443.wp-list-table .toggle-row:focus {
     444    -webkit-box-shadow:
     445        0 0 0 1px #5b9dd9,
     446                0 0 2px 1px rgba(30, 140, 190, .8);
     447    box-shadow:
     448        0 0 0 1px #5b9dd9,
     449                0 0 2px 1px rgba(30, 140, 190, .8);
     450}
     451
     452.ie8 .wp-list-table .toggle-row:focus {
     453        outline: #5b9dd9 solid 1px;
     454}
     455
     456.wp-list-table .toggle-row:active {
     457        -webkit-box-shadow: none;
     458        box-shadow: none;
     459}
     460
     461.wp-list-table .toggle-row:before {
     462        position: absolute;
     463        top: 0;
     464        left: 10px;
     465        display: block;
     466        padding: 0;
     467        color: #666;
     468        content: '\f140';
     469        font: normal 20px/1 'dashicons';
     470        line-height: 10px;
     471        -webkit-font-smoothing: antialiased;
     472        -moz-osx-font-smoothing: grayscale;
     473        speak: none;
     474}
     475
     476.wp-list-table .is-expanded .toggle-row:before {
     477        content: '\f142';
     478}
     479
    426480tr.wp-locked .locked-indicator {
    427481        margin-left: 6px;
    428482        height: 20px;
     
    16441698                font-size: 14px;
    16451699        }
    16461700
    1647         /* Columns to hide */
    1648         .fixed .column-date,
    1649         .fixed .column-author,
    1650         .column-categories,
    1651         .column-tags,
    1652         .tags .column-description,
    1653         .media .column-parent,
    1654         .media .column-comments,
    1655         .users .column-email,
    1656         .users .column-name,
    1657         .sites .column-registered,
    1658         .sites .column-users {
     1701        .wp-list-table th:not(.column-primary),
     1702        .wp-list-table th:not(.column-primary),
     1703        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
    16591704                display: none;
    16601705        }
    16611706
    1662         .fixed .column-comment .comment-author {
     1707        /* Checkboxes need to show */
     1708        .wp-list-table th.check-column {
     1709                display: table-cell;
     1710                width: 35px;
     1711        }
     1712
     1713        .wp-list-table .toggle-row {
    16631714                display: block;
    16641715        }
    16651716
    1666         /* Posts */
    1667         .column-title {
    1668                 width: 85%;
     1717        .wp-list-table tr:not(.inline-edit-row) td {
     1718                position: relative;
     1719                clear: both;
     1720                display: block;
     1721                width: auto !important; /* needs to override some columns that are more specifically targeted */
    16691722        }
    16701723
    1671         .fixed .column-comments, .widefat .check-column {
    1672                 width: 35px
     1724        .wp-list-table td.column-primary {
     1725                padding-right: 50px; /* space for toggle button */
    16731726        }
    16741727
     1728        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
     1729                padding: 3px 8px 3px 35% !important; /* space for the label */
     1730        }
     1731
     1732        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary)::before {
     1733                position: absolute;
     1734                left: 10px; /* match padding of regular table cell */
     1735                display: block;
     1736                overflow: hidden;
     1737                width: 32%; /* leave a little space for a gutter */
     1738                content: attr(data-colname);
     1739                white-space: nowrap;
     1740                text-overflow: ellipsis;
     1741        }
     1742
     1743        .wp-list-table .is-expanded td:not(.hidden) {
     1744                display: block !important;
     1745        }
     1746
     1747        .fixed .column-comment .comment-author {
     1748                display: block;
     1749        }
     1750
    16751751        .widefat thead .check-column, .widefat tfoot .check-column {
    16761752                padding: 10px 0 10px;
    16771753        }
  • 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

     
    726726                                $classes .= ' hidden';
    727727                        }
    728728
    729                         $attributes = "class='$classes'";
     729                        // Comments is a special case, as its column display name contains HTML
     730                        if ( 'comments' === $column_name ) {
     731                                $data = 'data-colname="' . esc_attr__( 'Comments' ) . '"';
     732                        } else {
     733                                $data = 'data-colname="' . esc_attr( $column_display_name ) . '"';
     734                        }
    730735
     736                        $attributes = "class='$classes' $data";
     737
    731738                        if ( 'cb' === $column_name ) {
    732739                                ?>
    733740                                <th scope="row" class="check-column">
  • 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();
  • 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);