Ticket #22502: 22502.2.diff
File 22502.2.diff, 4.4 KB (added by , 12 years ago) |
---|
-
wp-includes/js/media-editor.js
533 533 workflow.open(); 534 534 else 535 535 workflow = wp.media.editor.add( id ); 536 536 537 // Add focus to modal 538 $( '.media-menu .active' ).focus(); 539 537 540 return workflow; 538 541 } 539 542 }; -
wp-includes/js/media-views.js
550 550 this.frame.content.on( 'activate:browse', this.gallerySettings, this ); 551 551 552 552 media.controller.Library.prototype.activate.apply( this, arguments ); 553 554 // Make sure focus stays on modal 555 $( '.media-menu .active' ).focus(); 553 556 }, 554 557 555 558 deactivate: function() { … … 1491 1494 text: l10n.cancelGalleryTitle, 1492 1495 priority: 20, 1493 1496 click: function() { 1494 if ( previous ) 1497 if ( previous ) { 1495 1498 frame.state( previous ); 1496 else 1499 $( '.media-menu .active' ).focus(); 1500 } else { 1497 1501 frame.close(); 1502 } 1498 1503 } 1499 1504 }, 1500 1505 separateCancel: new media.View({ … … 1649 1654 template: media.template('media-modal'), 1650 1655 1651 1656 events: { 1652 'click .media-modal-backdrop, .media-modal-close' : 'closeHandler' 1657 'click .media-modal-backdrop, .media-modal-close' : 'closeHandler', 1658 'keyup' : 'keyboard' 1653 1659 }, 1654 1660 1655 1661 initialize: function() { … … 1715 1721 // Set and render the content. 1716 1722 this.options.$content = ( $content instanceof Backbone.View ) ? $content.$el : $content; 1717 1723 return this.render(); 1724 }, 1725 1726 keyboard: function( event ) { 1727 1728 if ( 27 !== event.which ) // Esc 1729 return; 1730 1731 this.close(); 1732 1733 event.preventDefault(); 1718 1734 } 1719 1735 }); 1720 1736 … … 2376 2392 className: 'media-menu-item', 2377 2393 2378 2394 events: { 2379 'click': 'click' 2395 'click': 'click', 2396 'keyup': 'keyboard' 2380 2397 }, 2381 2398 2382 2399 click: function() { … … 2388 2405 this.controller.state( options.state ); 2389 2406 }, 2390 2407 2408 keyboard: function( event ) { 2409 if ( 13 !== event.which ) // Enter 2410 return; 2411 2412 this.click(); 2413 2414 event.preventDefault(); 2415 }, 2416 2391 2417 render: function() { 2418 2419 this.$el.attr('tabIndex', '0'); 2420 2392 2421 var options = this.options; 2393 2422 2394 2423 if ( options.text ) … … 2417 2446 2418 2447 events: { 2419 2448 'click .attachment-preview': 'toggleSelection', 2449 'keyup .attachment-preview': 'toggleSelection', 2420 2450 'change [data-setting]': 'updateSetting', 2421 2451 'change [data-setting] input': 'updateSetting', 2422 2452 'change [data-setting] select': 'updateSetting', … … 2494 2524 }, 2495 2525 2496 2526 toggleSelection: function( event ) { 2527 2528 if ( event.type === 'keyup' && 13 !== event.which ) // Enter 2529 return; 2530 2497 2531 var selection = this.options.selection, 2498 2532 model = this.model; 2499 2533 -
wp-includes/media.php
1603 1603 </script> 1604 1604 1605 1605 <script type="text/html" id="tmpl-attachment"> 1606 <div class="attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}" >1606 <div class="attachment-preview type-{{ data.type }} subtype-{{ data.subtype }} {{ data.orientation }}" tabindex="0"> 1607 1607 <# if ( data.uploading ) { #> 1608 1608 <div class="media-progress-bar"><div></div></div> 1609 1609 <# } else if ( 'image' === data.type ) { #> … … 1624 1624 <# } #> 1625 1625 1626 1626 <# if ( data.buttons.check ) { #> 1627 <a class="check" href="#" ><span>✓</span><span class="dash">–</span></a>1627 <a class="check" href="#" tabindex="-1"><span>✓</span><span class="dash">–</span></a> 1628 1628 <# } #> 1629 1629 </div> 1630 1630 <# if ( data.describe ) { #> -
wp-includes/css/media-views.css
386 386 cursor: pointer; 387 387 } 388 388 389 .media-menu li:hover { 389 .media-menu li:hover, 390 .media-menu li:focus { 390 391 background: rgba( 0, 0, 0, 0.04 ); 392 outline: none; 391 393 } 392 394 393 395 .media-menu .active, … … 523 525 cursor: pointer; 524 526 } 525 527 528 .attachment-preview:focus { 529 outline: thin dotted; 530 } 531 526 532 .attachment .icon { 527 533 margin: 0 auto; 528 534 overflow: hidden;