Ticket #22502: 22502.diff
File 22502.diff, 1.9 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
491 491 // If the workflow exists, just open it. 492 492 if ( workflow ) { 493 493 workflow.open(); 494 $( '.media-modal #upload' ).focus(); 494 495 return; 495 496 } 496 497 497 498 // Initialize the editor's workflow if we haven't yet. 498 499 wp.media.editor.add( editor ); 500 501 // Add focus to modal 502 $( '.media-modal #upload' ).focus(); 499 503 }); 500 504 } 501 505 }; -
wp-includes/js/media-views.js
1641 1641 template: media.template('media-modal'), 1642 1642 1643 1643 events: { 1644 'click .media-modal-backdrop, .media-modal-close' : 'closeHandler' 1644 'click .media-modal-backdrop, .media-modal-close' : 'closeHandler', 1645 'keyup' : 'keyboard' 1645 1646 }, 1646 1647 1647 1648 initialize: function() { … … 1707 1708 // Set and render the content. 1708 1709 this.options.$content = ( $content instanceof Backbone.View ) ? $content.$el : $content; 1709 1710 return this.render(); 1711 }, 1712 1713 keyboard: function( event ) { 1714 1715 if ( 27 !== event.which ) // Esc 1716 return; 1717 1718 this.close(); 1719 1720 event.preventDefault(); 1710 1721 } 1711 1722 }); 1712 1723 … … 2365 2376 className: 'media-menu-item', 2366 2377 2367 2378 events: { 2368 'click': 'click' 2379 'click': 'click', 2380 'keyup': 'keyboard' 2369 2381 }, 2370 2382 2371 2383 click: function() { … … 2377 2389 this.controller.state( options.id ); 2378 2390 }, 2379 2391 2392 keyboard: function( event ) { 2393 if ( 13 !== event.which ) // Enter 2394 return; 2395 2396 this.click(); 2397 2398 event.preventDefault(); 2399 }, 2400 2380 2401 render: function() { 2402 2403 this.$el.attr('tabIndex', '0'); 2404 2381 2405 var options = this.options; 2382 2406 2383 2407 if ( options.text )