Ticket #36337: 36337.2.diff
File 36337.2.diff, 2.2 KB (added by , 9 years ago) |
---|
-
src/wp-admin/js/customize-controls.js
77 77 * @param {Function} [params.completeCallback] 78 78 */ 79 79 focus = function ( params ) { 80 var construct, completeCallback, focus ;80 var construct, completeCallback, focus, focusFirst; 81 81 construct = this; 82 82 params = params || {}; 83 83 focus = function () { … … 90 90 focusContainer = construct.container; 91 91 } 92 92 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 // Sections can tag an element as 'focus first' to opt out of the default first input focus. 94 focusFirst = focusContainer.find( '.focus-first' ).first(); 95 96 if ( 0 !== focusFirst.length ) { 97 focusFirst.focus(); 98 } else { 99 100 // Note that we can't use :focusable due to a jQuery UI issue. See: https://github.com/jquery/jquery-ui/pull/1583 101 focusContainer.find( 'input, select, textarea, button, object, a[href], [tabindex]' ).filter( ':visible' ).first().focus(); 102 } 95 103 }; 96 104 if ( params.completeCallback ) { 97 105 completeCallback = params.completeCallback; -
src/wp-includes/customize/class-wp-customize-media-control.php
196 196 <div class="actions"> 197 197 <# if ( data.canUpload ) { #> 198 198 <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 focus-first" id="{{ data.settings['default'] }}-button">{{ data.button_labels.change }}</button> 200 200 <div style="clear:both"></div> 201 201 <# } #> 202 202 </div>