Make WordPress Core

Ticket #29949: 29949.3.diff

File 29949.3.diff, 6.1 KB (added by celloexpressions, 10 years ago)

No 2nd expand button, remove animations, keep open sections/panels open.

  • src/wp-admin/css/customize-controls.css

     
    224224        transition: left .18s ease-in-out, color .1s ease-in-out, background .1s ease-in-out;
    225225}
    226226
    227 .collapsed .control-panel-back {
    228         display: none;
     227.collapsed .customize-controls-close {
     228        padding-right: 0;
    229229}
    230230
    231231.customize-controls-close:focus,
     
    431431        box-shadow: none !important;
    432432        -webkit-border-radius: 0 !important;
    433433        border-radius: 0 !important;
     434        position: fixed;
     435        left: 0;
     436        bottom: 0;
    434437}
    435438
    436 
    437439.collapse-sidebar:active,
    438440.collapse-sidebar:active .collapse-sidebar-label,
    439441.collapse-sidebar:active .collapse-sidebar-arrow:before {
     
    440442        text-shadow: none;
    441443}
    442444
    443 .collapsed .collapse-sidebar-arrow:before {
    444         color: #888;
     445
     446/* Collapsed Mode */
     447.collapsed .control-panel-back,
     448.expanded .expand-sidebar-label {
     449        display: none;
    445450}
    446451
     452.collapsed .accordion-section-content {
     453        display: none !important;
     454}
     455
     456.collapsed.in-sub-panel #customize-info,
     457.collapsed.in-sub-panel #customize-theme-controls > ul > .accordion-section,
     458.collapsed #customize-theme-controls .control-section.current-panel > h3.accordion-section-title {
     459        left: 0;
     460}
     461
     462@media screen and (min-width:600px) {
     463        .collapsed #customize-preview {
     464                left: 46px;
     465        }
     466
     467        .wp-full-overlay.collapsed #customize-controls {
     468                margin-left: 0;
     469                width: 46px;
     470                white-space: nowrap;
     471        }
     472
     473        .collapsed .wp-full-overlay-main {
     474                right: 0;
     475                width: auto;
     476        }
     477
     478        .collapsed #customize-info,
     479        .collapsed #customize-controls .accordion-section-title:after {
     480                display: none;
     481        }
     482
     483        .collapsed .control-section .accordion-section-title,
     484        .collapsed .control-panel .accordion-section-title {
     485                white-space: nowrap;
     486                overflow: hidden;
     487                text-overflow: ellipsis;
     488        }
     489
     490        .collapsed #customize-controls .wp-full-overlay-sidebar-content {
     491                overflow-y: hidden;
     492        }
     493
     494        /* No animation coming in, as it causes layout issues */
     495        .expanded.wp-full-overlay,
     496        .expanded #customize-preview,
     497        .expanded #customize-controls {
     498                transition: none;
     499        }
     500
     501        /* No animation going out, as it causes layout issues */
     502        .collapsed.wp-full-overlay,
     503        .collapsed #customize-preview,
     504        .collapsed #customize-controls {
     505                transition: none;
     506        }
     507}
     508
     509
    447510/* Style for custom settings */
    448511
    449512/*
  • src/wp-admin/css/customize-widgets.css

     
    394394        color: #777;
    395395}
    396396
    397 #customize-preview {
     397.in-sub-panel #customize-preview {
    398398        -webkit-transition: all 0.2s;
    399399        transition: all 0.2s;
    400400}
  • src/wp-admin/css/themes.css

     
    14701470
    14711471/* Collapse Button */
    14721472.wp-full-overlay a.collapse-sidebar {
    1473         position: absolute;
     1473        position: fixed;
    14741474        bottom: 12px;
    14751475        left: 0;
    14761476        z-index: 50;
     
    14891489        color: #0074a2;
    14901490}
    14911491
    1492 .wp-full-overlay.collapsed .collapse-sidebar {
    1493         position: absolute;
    1494         left: 100%;
    1495 }
    1496 
    14971492.wp-full-overlay .collapse-sidebar-arrow {
    14981493        position: static;
    14991494        margin-top: 0;
  • src/wp-admin/customize.php

     
    171171                </div>
    172172
    173173                <div id="customize-footer-actions" class="wp-full-overlay-footer">
    174                         <a href="#" class="collapse-sidebar button-secondary" title="<?php esc_attr_e('Collapse Sidebar'); ?>">
     174                        <a href="#" class="collapse-sidebar button-secondary">
    175175                                <span class="collapse-sidebar-arrow"></span>
    176                                 <span class="collapse-sidebar-label"><?php _e('Collapse'); ?></span>
     176                                <span class="collapse-sidebar-label"><?php _e( 'Collapse controls' ); ?></span>
     177                                <span class="expand-sidebar-label"><span class="screen-reader-text"><?php _e( 'Expand controls' ); ?></span></span>
    177178                        </a>
    178179                </div>
    179180        </form>
  • src/wp-admin/js/customize-controls.js

     
    11971197                });
    11981198
    11991199                $('.collapse-sidebar').on( 'click keydown', function( event ) {
    1200                         if ( event.type === 'keydown' &&  13 !== event.which ) // enter
     1200                        if ( event.type === 'keydown' &&  13 !== event.which ) { // enter
    12011201                                return;
     1202                        }
    12021203
    12031204                        overlay.toggleClass( 'collapsed' ).toggleClass( 'expanded' );
    12041205                        event.preventDefault();
    12051206                });
    12061207
     1208                // Expand Customizer controls on section icon click in collapsed mode.
     1209                $('.accordion-section-title').on( 'click keydown', function( event ) {
     1210                        if ( event.type === 'keydown' &&  13 !== event.which ) { // enter
     1211                                return;
     1212                        } else if ( overlay.hasClass( 'collapsed' ) ) {
     1213                                var section = $( this ).closest( '.control-section' );
     1214                                if ( section.hasClass( 'control-panel' ) ) {
     1215                                        if ( section.hasClass( 'current-panel' ) ) {
     1216                                                // Prevent panel-expand from triggering.
     1217                                                event.stopImmediatePropagation();
     1218                                        } else {
     1219                                                if ( overlay.hasClass( 'in-sub-panel' ) ) {
     1220                                                        $( '.control-panel-back' ).trigger( 'click' );
     1221                                                }
     1222                                        }
     1223                                } else {
     1224                                        if ( section.hasClass( 'open' ) ) {
     1225                                                // Prevent the section from trying to close.
     1226                                                event.stopImmediatePropagation();
     1227                                        }
     1228                                        else {
     1229                                                // Close any open sections/panels.
     1230                                                if ( overlay.hasClass( 'in-sub-panel' ) ) {
     1231                                                        $( '.control-panel-back' ).trigger( 'click' );
     1232                                                } else {
     1233                                                        $( '.control-section.open .accordion-section-title' ).trigger( 'click' );
     1234                                                }
     1235                                        }
     1236                                }
     1237                                // Expand the controls.
     1238                                $( '.collapse-sidebar' ).trigger( 'click' );
     1239                        }
     1240                });
     1241
    12071242                // Bind site title display to the corresponding field.
    12081243                if ( title.length ) {
    12091244                        $( '#customize-control-blogname input' ).on( 'input', function() {