Make WordPress Core

Ticket #32395: 32395.2.diff

File 32395.2.diff, 5.7 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        background: transparent;
     436}
     437
     438.wp-list-table .toggle-row:hover {
     439        cursor: pointer;
     440}
     441
     442.wp-list-table .toggle-row:focus {
     443        color: #124964;
     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:before {
     457        position: absolute;
     458        top: 0;
     459        left: 10px;
     460        display: block;
     461        padding: 0;
     462        color: #666;
     463        content: '\f140';
     464        font: normal 20px/1 'dashicons';
     465        line-height: 10px;
     466        -webkit-font-smoothing: antialiased;
     467        -moz-osx-font-smoothing: grayscale;
     468        speak: none;
     469}
     470
     471.wp-list-table .is-expanded .toggle-row:before {
     472        content: '\f142';
     473}
     474
    426475tr.wp-locked .locked-indicator {
    427476        margin-left: 6px;
    428477        height: 20px;
     
    16441693                font-size: 14px;
    16451694        }
    16461695
    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 {
     1696        .wp-list-table th:not(.column-primary),
     1697        .wp-list-table th:not(.column-primary),
     1698        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
    16591699                display: none;
    16601700        }
    16611701
    1662         .fixed .column-comment .comment-author {
     1702        /* Checkboxes need to show */
     1703        .wp-list-table th.check-column {
     1704                display: table-cell;
     1705                width: 35px;
     1706        }
     1707
     1708        .wp-list-table .toggle-row {
    16631709                display: block;
    16641710        }
    16651711
    1666         /* Posts */
    1667         .column-title {
    1668                 width: 85%;
     1712        .wp-list-table tr:not(.inline-edit-row) td {
     1713                position: relative;
     1714                clear: both;
     1715                display: block;
     1716                width: auto !important; /* needs to override some columns that are more specifically targeted */
    16691717        }
    16701718
    1671         .fixed .column-comments, .widefat .check-column {
    1672                 width: 35px
     1719        .wp-list-table td.column-primary {
     1720                padding-right: 50px; /* space for toggle button */
    16731721        }
    16741722
     1723        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary) {
     1724                padding: 3px 8px 3px 35% !important; /* space for the label */
     1725        }
     1726
     1727        .wp-list-table tr:not(.inline-edit-row) td:not(.column-primary)::before {
     1728                position: absolute;
     1729                left: 10px; /* match padding of regular table cell */
     1730                display: block;
     1731                overflow: hidden;
     1732                width: 32%; /* leave a little space for a gutter */
     1733                content: attr(data-colname);
     1734                white-space: nowrap;
     1735                text-overflow: ellipsis;
     1736        }
     1737
     1738        .wp-list-table .is-expanded td {
     1739                display: block !important;
     1740        }
     1741
     1742        .fixed .column-comment .comment-author {
     1743                display: block;
     1744        }
     1745
    16751746        .widefat thead .check-column, .widefat tfoot .check-column {
    16761747                padding: 10px 0 10px;
    16771748        }
     
    19071978        }
    19081979
    19091980        .widefat tbody th.check-column input[type="checkbox"] {
    1910                 margin-top: -3px;
     1981                margin-top: -4px;
    19111982                margin-left: 8px;
    19121983        }
    19131984
  • 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 );
     
    957959                        elseif ( in_array( $column_key, array( 'posts', 'comments', 'links' ) ) )
    958960                                $class[] = 'num';
    959961
     962                        if ( $column_key === $primary ) {
     963                                $class[] = 'column-primary';
     964                        }
     965
    960966                        if ( isset( $sortable[$column_key] ) ) {
    961967                                list( $orderby, $desc_first ) = $sortable[$column_key];
    962968
  • src/wp-admin/includes/class-wp-posts-list-table.php

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