Changeset 33413
- Timestamp:
- 07/24/2015 08:27:04 PM (10 years ago)
- Location:
- trunk/src
- Files:
-
- 5 edited
-
wp-admin/css/customize-nav-menus.css (modified) (4 diffs)
-
wp-admin/js/accordion.js (modified) (3 diffs)
-
wp-admin/js/customize-nav-menus.js (modified) (5 diffs)
-
wp-includes/class-wp-customize-control.php (modified) (1 diff)
-
wp-includes/class-wp-customize-nav-menus.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/css/customize-nav-menus.css
r33410 r33413 621 621 } 622 622 623 #available-menu-items .open .accordion-section-title:after { 623 /* rework the arrow indicator implementation for NVDA bug see #32715 */ 624 #available-menu-items .accordion-section-title:after { 625 content: none !important; 626 } 627 628 #available-menu-items .accordion-section-title .toggle-indicator { 629 display: inline-block; 630 font-size: 20px; 631 line-height: 1; 632 } 633 634 #available-menu-items .accordion-section-title .toggle-indicator:after { 635 content: '\f140'; 636 font: normal 20px/1 'dashicons'; 637 color: #a0a5aa; 638 vertical-align: top; 639 speak: none; 640 -webkit-font-smoothing: antialiased; 641 -moz-osx-font-smoothing: grayscale; 642 text-decoration: none !important; 643 } 644 645 #available-menu-items .accordion-section-title:hover .toggle-indicator:after { 646 color: #777; 647 } 648 649 #available-menu-items .open .accordion-section-title .toggle-indicator:after { 624 650 content: '\f142'; 625 651 } … … 646 672 display: block; 647 673 width: 28px; 648 height: 3 2px;674 height: 35px; 649 675 position: absolute; 650 676 top: 5px; 651 677 right: 5px; 678 cursor: pointer; 652 679 } 653 680 … … 658 685 659 686 #available-menu-items .accordion-section-title .no-items, 660 #available-menu-items .cannot-expand .accordion-section-title .spinner { 661 display: none; 687 #available-menu-items .cannot-expand .accordion-section-title .spinner, 688 #available-menu-items .cannot-expand .accordion-section-title > button { 689 display: none; 690 } 691 692 #available-menu-items-search.cannot-expand .accordion-section-title .spinner { 693 display: block; 662 694 } 663 695 … … 779 811 #available-menu-items-search .spinner { 780 812 position: absolute; 781 top: 18px;813 top: 20px; 782 814 margin: 0 !important; 783 815 right: 20px; -
trunk/src/wp-admin/js/accordion.js
r31471 r33413 54 54 function accordionSwitch ( el ) { 55 55 var section = el.closest( '.accordion-section' ), 56 sectionToggleControl = section.find( '[aria-expanded]' ).first(), 56 57 siblings = section.closest( '.accordion-container' ).find( '.open' ), 58 siblingsToggleControl = siblings.find( '[aria-expanded]' ).first(), 57 59 content = section.find( '.accordion-section-content' ); 58 60 … … 66 68 content.toggle( true ).slideToggle( 150 ); 67 69 } else { 70 siblingsToggleControl.attr( 'aria-expanded', 'false' ); 68 71 siblings.removeClass( 'open' ); 69 72 siblings.find( '.accordion-section-content' ).show().slideUp( 150 ); … … 71 74 section.toggleClass( 'open' ); 72 75 } 76 77 // If there's an element with an aria-expanded attribute, assume it's a toggle control and toggle the aria-expanded value. 78 if ( sectionToggleControl ) { 79 sectionToggleControl.attr( 'aria-expanded', String( sectionToggleControl.attr( 'aria-expanded' ) === 'false' ) ); 80 } 73 81 } 74 82 -
trunk/src/wp-admin/js/customize-nav-menus.js
r33412 r33413 154 154 this.sectionContent.scroll( function() { 155 155 var totalHeight = self.$el.find( '.accordion-section.open .accordion-section-content' ).prop( 'scrollHeight' ), 156 visibleHeight = self.$el.find( '.accordion-section.open' ).height(); 156 visibleHeight = self.$el.find( '.accordion-section.open' ).height(); 157 157 158 if ( ! self.loading && $( this ).scrollTop() > 3 / 4 * totalHeight - visibleHeight ) { 158 159 var type = $( this ).data( 'type' ), 159 object = $( this ).data( 'object' ); 160 object = $( this ).data( 'object' ); 161 160 162 if ( 'search' === type ) { 161 163 if ( self.searchTerm ) { … … 174 176 // Search input change handler. 175 177 search: function( event ) { 178 var $searchSection = $( '#available-menu-items-search' ), 179 $openSections = $( '#available-menu-items .accordion-section.open' ); 180 176 181 if ( ! event ) { 177 182 return; 178 183 } 179 184 // Manual accordion-opening behavior. 180 if ( this.searchTerm && ! $( '#available-menu-items-search' ).hasClass( 'open' ) ) { 181 $( '#available-menu-items .accordion-section-content' ).slideUp( 'fast' ); 182 $( '#available-menu-items-search .accordion-section-content' ).slideDown( 'fast' ); 183 $( '#available-menu-items .accordion-section.open' ).removeClass( 'open' ); 184 $( '#available-menu-items-search' ).addClass( 'open' ); 185 if ( this.searchTerm && ! $searchSection.hasClass( 'open' ) ) { 186 $openSections.find( '.accordion-section-content' ).slideUp( 'fast' ); 187 $searchSection.find( '.accordion-section-content' ).slideDown( 'fast' ); 188 $openSections.find( '[aria-expanded]' ).first().attr( 'aria-expanded', 'false' ); 189 $openSections.removeClass( 'open' ); 190 $searchSection.addClass( 'open' ); 185 191 } 186 192 if ( '' === event.target.value ) { 187 $ ( '#available-menu-items-search' ).removeClass( 'open' );193 $searchSection.removeClass( 'open' ); 188 194 } 189 195 if ( this.searchTerm === event.target.value ) { … … 198 204 doSearch: function( page ) { 199 205 var self = this, params, 200 $section = $( '#available-menu-items-search' ),201 $content = $section.find( '.accordion-section-content' ),202 itemTemplate = wp.template( 'available-menu-item' );206 $section = $( '#available-menu-items-search' ), 207 $content = $section.find( '.accordion-section-content' ), 208 itemTemplate = wp.template( 'available-menu-item' ); 203 209 204 210 if ( self.currentRequest ) { … … 1992 1998 toggleReordering: function( showOrHide ) { 1993 1999 var addNewItemBtn = this.container.find( '.add-new-menu-item' ), 1994 reorderBtn = this.container.find( '.reorder-toggle' ); 2000 reorderBtn = this.container.find( '.reorder-toggle' ), 2001 itemsTitle = this.$sectionContent.find( '.item-title' ); 1995 2002 1996 2003 showOrHide = Boolean( showOrHide ); … … 2004 2011 this.$sectionContent.sortable( this.isReordering ? 'disable' : 'enable' ); 2005 2012 if ( this.isReordering ) { 2006 addNewItemBtn.attr( 'tabindex', '-1');2013 addNewItemBtn.attr({ 'tabindex': '-1', 'aria-hidden': 'true' }); 2007 2014 reorderBtn.attr( 'aria-label', api.Menus.data.l10n.reorderLabelOff ); 2008 2015 wp.a11y.speak( api.Menus.data.l10n.reorderModeOn ); 2016 itemsTitle.attr( 'aria-hidden', 'false' ); 2009 2017 } else { 2010 addNewItemBtn.removeAttr( 'tabindex ' );2018 addNewItemBtn.removeAttr( 'tabindex aria-hidden' ); 2011 2019 reorderBtn.attr( 'aria-label', api.Menus.data.l10n.reorderLabelOn ); 2012 2020 wp.a11y.speak( api.Menus.data.l10n.reorderModeOff ); 2021 itemsTitle.attr( 'aria-hidden', 'true' ); 2013 2022 } 2014 2023 -
trunk/src/wp-includes/class-wp-customize-control.php
r33366 r33413 1680 1680 <div class="menu-item-bar"> 1681 1681 <div class="menu-item-handle"> 1682 <span class="item-type" >{{ data.item_type_label }}</span>1683 <span class="item-title" >1682 <span class="item-type" aria-hidden="true">{{ data.item_type_label }}</span> 1683 <span class="item-title" aria-hidden="true"> 1684 1684 <span class="spinner"></span> 1685 1685 <span class="menu-item-title<# if ( ! data.title ) { #> no-title<# } #>">{{ data.title || wp.customize.Menus.data.l10n.untitled }}</span> 1686 1686 </span> 1687 1687 <span class="item-controls"> 1688 <button type="button" class="not-a-button item-edit"><span class="screen-reader-text"><?php _e( 'Edit Menu Item' ); ?></span></button> 1689 <button type="button" class="not-a-button item-delete submitdelete deletion"><span class="screen-reader-text"><?php _e( 'Remove Menu Item' ); ?></span></button> 1688 <button type="button" class="not-a-button item-edit"><span class="screen-reader-text"><?php 1689 /* translators: 1: Title of a menu item, 2: Type of a menu item */ 1690 printf( __( 'Edit menu item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' ); 1691 ?></span></button> 1692 <button type="button" class="not-a-button item-delete submitdelete deletion"><span class="screen-reader-text"><?php 1693 /* translators: 1: Title of a menu item, 2: Type of a menu item */ 1694 printf( __( 'Remove Menu Item: %1$s (%2$s)' ), '{{ data.title || wp.customize.Menus.data.l10n.untitled }}', '{{ data.item_type_label }}' ); 1695 ?></span></button> 1690 1696 </span> 1691 1697 </div> -
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r33366 r33413 722 722 </div> 723 723 <div id="new-custom-menu-item" class="accordion-section"> 724 <h4 class="accordion-section-title"><?php _e( 'Custom Links' ); ?><button type="button" class="not-a-button"><span class="screen-reader-text"><?php _e( 'Toggle' ); ?></span></button></h4> 724 <h4 class="accordion-section-title" role="presentation"> 725 <?php _e( 'Custom Links' ); ?> 726 <button type="button" class="not-a-button" aria-expanded="false"> 727 <span class="screen-reader-text"><?php _e( 'Toggle section: Custom Links' ); ?></span> 728 <span class="toggle-indicator" aria-hidden="true"></span> 729 </button> 730 </h4> 725 731 <div class="accordion-section-content"> 726 732 <input type="hidden" value="custom" id="custom-menu-item-type" name="menu-item[-1][menu-item-type]" /> … … 751 757 ?> 752 758 <div id="<?php echo esc_attr( $id ); ?>" class="accordion-section"> 753 <h4 class="accordion-section-title"><?php echo esc_html( $available_item_type['title'] ); ?> <span class="no-items"><?php _e( 'No items' ); ?></span><span class="spinner"></span> <button type="button" class="not-a-button"><span class="screen-reader-text"><?php _e( 'Toggle' ); ?></span></button></h4> 759 <h4 class="accordion-section-title" role="presentation"> 760 <?php echo esc_html( $available_item_type['title'] ); ?> 761 <span class="spinner"></span> 762 <span class="no-items"><?php _e( 'No items' ); ?></span> 763 <button type="button" class="not-a-button" aria-expanded="false"> 764 <span class="screen-reader-text"><?php 765 /* translators: %s: Title of a section with menu items */ 766 printf( 'Toggle section: %s', esc_html( $available_item_type['title'] ) ); ?></span> 767 <span class="toggle-indicator" aria-hidden="true"></span> 768 </button> 769 </h4> 754 770 <ul class="accordion-section-content" data-type="<?php echo esc_attr( $available_item_type['type'] ); ?>" data-object="<?php echo esc_attr( $available_item_type['object'] ); ?>"></ul> 755 771 </div>
Note: See TracChangeset
for help on using the changeset viewer.