Make WordPress Core

Ticket #36337: 36337.3.diff

File 36337.3.diff, 2.1 KB (added by westonruter, 8 years ago)
  • src/wp-admin/js/customize-controls.js

    diff --git src/wp-admin/js/customize-controls.js src/wp-admin/js/customize-controls.js
    index a22aa76..5c0d0a4 100644
     
    7777         * @param {Function} [params.completeCallback]
    7878         */
    7979        focus = function ( params ) {
    80                 var construct, completeCallback, focus;
     80                var construct, completeCallback, focus, focusElement;
    8181                construct = this;
    8282                params = params || {};
    8383                focus = function () {
     
    9090                                focusContainer = construct.container;
    9191                        }
    9292
    93                         // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
    94                         focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first().focus();
     93                        focusElement = focusContainer.find( '.control-focus:first' );
     94                        if ( 0 === focusElement.length ) {
     95                                // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583
     96                                focusElement = focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first();
     97                        }
     98                        focusElement.focus();
    9599                };
    96100                if ( params.completeCallback ) {
    97101                        completeCallback = params.completeCallback;
  • src/wp-includes/customize/class-wp-customize-media-control.php

    diff --git src/wp-includes/customize/class-wp-customize-media-control.php src/wp-includes/customize/class-wp-customize-media-control.php
    index bcd8db8..f066c02 100644
    class WP_Customize_Media_Control extends WP_Customize_Control { 
    196196                        <div class="actions">
    197197                                <# if ( data.canUpload ) { #>
    198198                                <button type="button" class="button remove-button">{{ data.button_labels.remove }}</button>
    199                                 <button type="button" class="button upload-button" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button>
     199                                <button type="button" class="button upload-button control-focus" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button>
    200200                                <div style="clear:both"></div>
    201201                                <# } #>
    202202                        </div>