Make WordPress Core

Ticket #28946: 28946.diff

File 28946.diff, 7.2 KB (added by helen, 12 years ago)
  • src/wp-admin/css/list-tables.css

     
    595595        padding: 2px 8px 0 0;
    596596}
    597597
     598.wp-filter .actions {
     599        display: inline-block;
     600        vertical-align: middle;
     601}
     602
    598603.tablenav .delete {
    599604        margin-right: 20px;
    600605}
     
    617622        color: #2ea2cc;
    618623}
    619624
    620 .view-switch {
     625tablenav .view-switch {
    621626        float: right;
    622627        margin: 5px 16px 0 8px;
    623628}
    624629
     630.wp-filter .view-switch {
     631        display: inline-block;
     632        vertical-align: middle;
     633        padding: 14px 0;
     634        margin: 0 20px 0 0;
     635}
     636
    625637.view-switch a {
    626638        text-decoration: none;
    627639}
     
    14371449                display: block;
    14381450        }
    14391451
    1440         .tablenav.top .actions, .view-switch {
     1452        .tablenav.top .actions,
     1453        .tablenav .view-switch {
    14411454                display: none;
    14421455        }
    14431456
  • src/wp-admin/css/media.css

     
    507507        border: 4px dashed #bbb;
    508508}
    509509
    510 .media-frame.mode-grid .media-toolbar select {
    511         margin-top: 1px;
    512         font-size: inherit;
    513 }
    514 
    515 .media-frame.mode-grid .attachments-browser .bulk-select {
    516         display: inline-block;
    517         margin: 0 10px 0 0;
    518 }
    519 
    520510.media-frame.mode-grid .attachments,
    521511.media-frame.mode-select .attachments {
    522512        padding: 2px;
     
    524514
    525515.media-frame.mode-select .attachments-browser.fixed .attachments {
    526516        position: relative;
    527         top: 80px; /* prevent jumping up when the toolbar becomes fixed */
    528         padding-bottom: 80px; /* offset for above so the bottom doesn't get cut off */
     517        top: 97px; /* prevent jumping up when the toolbar becomes fixed */
     518        padding-bottom: 97px; /* offset for above so the bottom doesn't get cut off */
    529519}
    530520
    531521.media-frame.mode-grid .attachment:focus,
     
    571561 *
    572562 * This should be OOCSS'd so both use a shared selector.
    573563 */
    574 .media-frame.mode-grid .attachments-browser .media-toolbar {
    575         background: #fff;
    576         -webkit-box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
    577         box-shadow: 0 1px 1px 0 rgba(0,0,0,.1);
    578         -webkit-box-sizing: border-box;
    579         -moz-box-sizing: border-box;
    580         box-sizing: border-box;
    581         color: #555;
    582         display: inline-block;
    583         font-size: 13px;
    584         margin: 20px 0;
    585         padding: 0 20px;
    586         position: relative;
    587         width: 100%;
     564
     565.media-frame.mode-grid .media-toolbar {
     566        margin: 20px 0 16px;
    588567        height: auto;
    589         border: none;
    590568}
    591569
    592 .media-frame.mode-select .attachments-browser.fixed .media-toolbar {
    593         position: fixed;
    594         top: 32px;
    595         left: auto;
    596         right: 20px;
    597         margin-top: 0;
     570.media-frame.mode-grid .media-toolbar select {
     571        margin: 0 10px 0 0;
     572        font-size: inherit;
    598573}
    599574
    600 .media-frame.mode-grid input[type="search"] {
    601         margin: 1px;
    602         padding: 3px 5px;
    603         position: absolute;
    604         right: 10px;
    605         top: 9px;
    606         font-size: 16px;
    607         font-weight: 300;
    608         line-height: 1.5;
    609         width: 280px;
     575.media-frame.mode-grid .media-toolbar-secondary > .media-button {
     576        margin-top: 10px;
     577        margin-bottom: 10px;
    610578}
    611579
    612 .media-frame.mode-grid .view-switch {
     580.media-frame.mode-grid .attachments-browser .bulk-select {
    613581        display: inline-block;
    614         float: none;
    615         vertical-align: middle;
    616         padding: 15px 0;
    617         margin: 0 20px 0 0;
     582        margin: 0 10px 0 0;
    618583}
    619584
    620 .media-frame.mode-grid select {
    621         margin: 0 10px 0 0;
     585.media-frame.mode-grid .search {
     586        margin-top: 0;
    622587}
    623588
    624589.media-frame.mode-grid .spinner {
     
    629594        margin-right: 10px;
    630595}
    631596
     597.media-frame.mode-select .attachments-browser.fixed .media-toolbar {
     598        position: fixed;
     599        top: 32px;
     600        left: auto;
     601        right: 20px;
     602        margin-top: 0;
     603}
     604
    632605.media-frame.mode-grid .attachments-browser {
    633606        padding: 0;
    634607}
     
    11521125 */
    11531126
    11541127@media only screen and (max-width: 1120px) {
    1155         .media-frame.mode-grid .attachments-browser .media-toolbar-primary,
    11561128        .media-frame.mode-grid .attachments-browser .media-toolbar-secondary {
    11571129                float: none;
    11581130        }
    1159 
    1160         .media-frame.mode-grid input[type="search"] {
    1161                 margin: 20px 0;
    1162                 position: static;
    1163                 width: 100%;
    1164                 max-width: 280px;
    1165         }
    11661131}
    11671132
    11681133@media only screen and ( max-width: 782px ) {
  • src/wp-admin/includes/class-wp-media-list-table.php

     
    9191        }
    9292
    9393        protected function extra_tablenav( $which ) {
     94                if ( 'bar' !== $which ) {
     95                        return;
     96                }
    9497?>
    95                 <div class="alignleft actions">
     98                <div class="actions">
    9699<?php
    97                 if ( 'top' == $which && !is_singular() && !$this->detached && !$this->is_trash ) {
     100                if ( ! is_singular() && ! $this->detached && ! $this->is_trash ) {
    98101                        $this->months_dropdown( 'attachment' );
    99102
    100103                        /** This action is documented in wp-admin/includes/class-wp-posts-list-table.php */
     
    131134                global $mode;
    132135
    133136                parent::pagination( $which );
    134 
    135                 $this->view_switcher( $mode );
    136137        }
    137138
    138139        /**
     
    167168<?php
    168169        }
    169170
     171        /**
     172         * Override parent views so we can use the filter bar display.
     173         */
     174        public function views() {
     175                global $mode;
     176
     177                $views = $this->get_views();
     178
     179                /** This filter is documented in wp-admin/inclues/class-wp-list-table.php */
     180                $views = apply_filters( "views_{$this->screen->id}", $views );
     181?>
     182<div class="wp-filter">
     183        <?php $this->view_switcher( $mode ); ?>
     184
     185        <ul class="filter-links">
     186                <?php
     187                if ( ! empty( $views ) ) {
     188                        foreach ( $views as $class => $view ) {
     189                                $views[ $class ] = "\t<li class='$class'>$view";
     190                        }
     191                        echo implode( " </li>\n", $views ) . "</li>\n";
     192                }
     193                ?>
     194        </ul>
     195
     196        <?php $this->extra_tablenav( 'bar' ); ?>
     197</div>
     198<?php
     199        }
     200
    170201        public function get_columns() {
    171202                $posts_columns = array();
    172203                $posts_columns['cb'] = '<input type="checkbox" />';
  • src/wp-includes/js/media-grid.js

     
    179179                        $browser = this.$('.attachments-browser');
    180180                        $toolbar = $browser.find('.media-toolbar');
    181181
    182                         if ( $browser.offset().top < this.$window.scrollTop() + this.$adminBar.height() ) {
     182                        // Offset doesn't appear to take top margin into account, hence +20
     183                        if ( ( $browser.offset().top + 20 ) < this.$window.scrollTop() + this.$adminBar.height() ) {
    183184                                $browser.addClass( 'fixed' );
    184185                                $toolbar.css('width', $browser.width() + 'px');
    185186                        } else {
  • src/wp-includes/js/media-views.js

     
    39373937         */
    39383938        media.view.Toolbar = media.View.extend({
    39393939                tagName:   'div',
    3940                 className: 'media-toolbar',
     3940                className: 'media-toolbar wp-filter',
    39413941
    39423942                initialize: function() {
    39433943                        var state = this.controller.state(),
     
    39493949                        // The toolbar is composed of two `PriorityList` views.
    39503950                        this.primary   = new media.view.PriorityList();
    39513951                        this.secondary = new media.view.PriorityList();
    3952                         this.primary.$el.addClass('media-toolbar-primary');
     3952                        this.primary.$el.addClass('media-toolbar-primary search-form');
    39533953                        this.secondary.$el.addClass('media-toolbar-secondary');
    39543954
    39553955                        this.views.set([ this.secondary, this.primary ]);