Ticket #23560: 23560.4.diff
File 23560.4.diff, 5.1 KB (added by , 10 years ago) |
---|
-
src/wp-includes/css/media-views.css
431 431 border-right: 0; 432 432 } 433 433 434 .media-router > a:active, 435 .media-router > a:focus { 434 .media-router > a:active { 436 435 outline: none; 437 436 } 438 437 … … 635 634 user-select: none; 636 635 } 637 636 637 .attachment:focus { 638 box-shadow: 0px 0px 2pt 2pt #1e8cbe; 639 outline: none; 640 } 641 642 .isIE .attachment:focus { 643 outline: #1e8cbe solid; 644 } 645 638 646 .selected.attachment { 639 647 box-shadow: 640 648 0 0 0 1px #fff, 641 649 0 0 0 3px #ccc; 642 650 } 643 651 652 .isIE .attachment.selected { 653 outline: #1e8cbe solid; 654 } 655 644 656 .details.attachment { 645 657 box-shadow: 646 658 0 0 0 1px #fff, … … 864 876 right: 300px; 865 877 bottom: 0; 866 878 overflow: auto; 879 outline: none; 867 880 } 868 881 869 882 .attachments-browser .instructions { -
src/wp-includes/js/media-views.js
1638 1638 if ( ! this.views.attached || ! this.$el.is(':visible') ) 1639 1639 return this; 1640 1640 1641 this.$el.hide(); 1641 // Hide modal and remove restricted media modal tab focus once it's closed 1642 this.$el.hide().undelegate( 'keydown' ); 1643 1644 // Put focus back in useful location once modal is closed 1645 $('#wpbody-content').focus(); 1646 1642 1647 this.propagate('close'); 1643 1648 1644 1649 // If the `freeze` option is set, restore the container's scroll position. … … 1684 1689 this.escape(); 1685 1690 return; 1686 1691 } 1692 1693 // Keep tab focus within media modal while it's open 1694 if ( $.ui.keyCode.TAB !== event.keyCode ) 1695 return; 1696 1697 var tabbables = $( ':tabbable', this.$el ), 1698 first = tabbables.filter( ':first' ), 1699 last = tabbables.filter( ':last' ); 1700 1701 if ( event.target === last[0] && !event.shiftKey ) { 1702 first.focus(); 1703 return false; 1704 } else if ( event.target === first[0] && event.shiftKey ) { 1705 last.focus(); 1706 return false; 1707 } 1687 1708 } 1688 1709 }); 1689 1710 … … 2497 2518 className: 'attachment', 2498 2519 template: media.template('attachment'), 2499 2520 2521 attributes: { 2522 tabIndex: 0, 2523 role: 'checkbox' 2524 }, 2525 2500 2526 events: { 2501 2527 'click .attachment-preview': 'toggleSelectionHandler', 2502 2528 'change [data-setting]': 'updateSetting', … … 2505 2531 'change [data-setting] textarea': 'updateSetting', 2506 2532 'click .close': 'removeFromLibrary', 2507 2533 'click .check': 'removeFromSelection', 2508 'click a': 'preventDefault' 2534 'click a': 'preventDefault', 2535 'keydown': 'toggleSelectionHandler' 2509 2536 }, 2510 2537 2511 2538 buttons: {}, … … 2513 2540 initialize: function() { 2514 2541 var selection = this.options.selection; 2515 2542 2543 this.$el.attr('aria-label', this.model.attributes.title).attr('aria-checked', false); 2544 2516 2545 this.model.on( 'change:sizes change:uploading', this.render, this ); 2517 2546 this.model.on( 'change:title', this._syncTitle, this ); 2518 2547 this.model.on( 'change:caption', this._syncCaption, this ); … … 2603 2632 toggleSelectionHandler: function( event ) { 2604 2633 var method; 2605 2634 2635 if ( 'keydown' === event.type && $.ui.keyCode.ENTER !== event.keyCode && $.ui.keyCode.SPACE !== event.keyCode ) 2636 return; 2637 2606 2638 if ( event.shiftKey ) 2607 2639 method = 'between'; 2608 2640 else if ( event.ctrlKey || event.metaKey ) … … 2686 2718 if ( ! selection || ( collection && collection !== selection ) ) 2687 2719 return; 2688 2720 2689 this.$el.addClass('selected') ;2721 this.$el.addClass('selected').attr('aria-checked', true); 2690 2722 }, 2691 2723 2692 2724 deselect: function( model, collection ) { … … 2698 2730 if ( ! selection || ( collection && collection !== selection ) ) 2699 2731 return; 2700 2732 2701 this.$el.removeClass('selected') ;2733 this.$el.removeClass('selected').attr('aria-checked', false); 2702 2734 }, 2703 2735 2704 2736 details: function( model, collection ) { … … 2880 2912 tagName: 'ul', 2881 2913 className: 'attachments', 2882 2914 2915 attributes: { 2916 tabIndex: -1 2917 }, 2918 2883 2919 cssTemplate: media.template('attachments-css'), 2884 2920 2885 2921 events: { -
src/wp-includes/media-template.php
15 15 function wp_print_media_templates() { 16 16 global $is_IE; 17 17 $class = 'media-modal wp-core-ui'; 18 if ( $is_IE ) 19 $class .= ' isIE'; 18 20 if ( $is_IE && strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7') !== false ) 19 21 $class .= ' ie7'; 20 22 ?> … … 134 136 <# } else if ( 'image' === data.type ) { #> 135 137 <div class="thumbnail"> 136 138 <div class="centered"> 137 <img src="{{ data.size.url }}" draggable="false" />139 <img src="{{ data.size.url }}" draggable="false" alt="" /> 138 140 </div> 139 141 </div> 140 142 <# } else { #> … … 149 151 <# } #> 150 152 151 153 <# if ( data.buttons.check ) { #> 152 <a class="check" href="#" title="<?php _e('Deselect'); ?>" ><div class="media-modal-icon"></div></a>154 <a class="check" href="#" title="<?php _e('Deselect'); ?>" tabindex="-1"><div class="media-modal-icon"></div></a> 153 155 <# } #> 154 156 </div> 155 157 <#