Make WordPress Core

Ticket #31014: 31014.3.diff

File 31014.3.diff, 1.7 KB (added by westonruter, 10 years ago)

Additional change: https://github.com/xwp/wordpress-develop/commit/45f0813055918ad5f2f542824cc10d3f89734768

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

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index 86cb949..380a722 100644
     
    6767                construct = this;
    6868                params = params || {};
    6969                focus = function () {
    70                         construct.container.find( ':focusable:first' ).focus();
    71                         construct.container[0].scrollIntoView( true );
     70                        var focusContainer;
     71                        if ( construct.extended( api.Panel ) && construct.expanded() ) {
     72                                focusContainer = construct.container.find( '.control-panel-content:first' );
     73                        } else {
     74                                focusContainer = construct.container;
     75                        }
     76                        focusContainer.find( ':focusable:first' ).focus();
     77                        focusContainer[0].scrollIntoView( true );
    7278                };
    7379                if ( params.completeCallback ) {
    7480                        completeCallback = params.completeCallback;
     
    715721                                content.show( 0, function() {
    716722                                        position = content.offset().top;
    717723                                        scroll = container.scrollTop();
    718                                         content.css( 'margin-top', ( 45 - position - scroll ) );
     724                                        content.css( 'margin-top', ( $( '#customize-header-actions' ).height() - position - scroll ) );
    719725                                        section.addClass( 'current-panel' );
    720726                                        overlay.addClass( 'in-themes-panel' );
    721727                                        container.scrollTop( 0 );
     
    10391045                                });
    10401046
    10411047                                content.show( 0, function() {
     1048                                        content.parent().show();
    10421049                                        position = content.offset().top;
    10431050                                        scroll = container.scrollTop();
    1044                                         content.css( 'margin-top', ( 45 - position - scroll ) );
     1051                                        content.css( 'margin-top', ( $( '#customize-header-actions' ).height() - position - scroll ) );
    10451052                                        section.addClass( 'current-panel' );
    10461053                                        overlay.addClass( 'in-sub-panel' );
    10471054                                        container.scrollTop( 0 );