Changeset 32891
- Timestamp:
- 06/20/2015 07:21:38 PM (11 years ago)
- Location:
- trunk/src
- Files:
-
- 2 edited
-
wp-admin/js/customize-nav-menus.js (modified) (5 diffs)
-
wp-includes/class-wp-customize-nav-menus.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/customize-nav-menus.js
r32890 r32891 126 126 this.sectionContent = this.$el.find( '.accordion-section-content' ); 127 127 128 this.debounceSearch = _.debounce( self.search, 250 );128 this.debounceSearch = _.debounce( self.search, 500 ); 129 129 130 130 _.bindAll( this, 'close' ); … … 212 212 } else if ( page > 1 ) { 213 213 $section.addClass( 'loading-more' ); 214 $content.attr( 'aria-busy', 'true' ); 215 wp.a11y.speak( api.Menus.data.l10n.itemsLoadingMore ); 214 216 } else if ( '' === self.searchTerm ) { 215 217 $content.html( '' ); 218 wp.a11y.speak( '' ); 216 219 return; 217 220 } … … 235 238 } 236 239 $section.removeClass( 'loading loading-more' ); 240 $content.attr( 'aria-busy', 'false' ); 237 241 $section.addClass( 'open' ); 238 242 self.loading = false; … … 247 251 self.pages.search = self.pages.search + 1; 248 252 } 253 if ( items && page > 1 ) { 254 wp.a11y.speak( api.Menus.data.l10n.itemsFoundMore.replace( '%d', items.length ) ); 255 } else if ( items && page === 1 ) { 256 wp.a11y.speak( api.Menus.data.l10n.itemsFound.replace( '%d', items.length ) ); 257 } 249 258 }); 250 259 251 260 self.currentRequest.fail(function( data ) { 252 $content.empty().append( $( '<p class="nothing-found"></p>' ).text( data.message ) ); 253 wp.a11y.speak( data.message ); 261 // data.message may be undefined, for example when typing slow and the request is aborted. 262 if ( data.message ) { 263 $content.empty().append( $( '<p class="nothing-found"></p>' ).text( data.message ) ); 264 wp.a11y.speak( data.message ); 265 } 254 266 self.pages.search = -1; 255 267 }); … … 257 269 self.currentRequest.always(function() { 258 270 $section.removeClass( 'loading loading-more' ); 271 $content.attr( 'aria-busy', 'false' ); 259 272 self.loading = false; 260 273 self.currentRequest = null; -
trunk/src/wp-includes/class-wp-customize-nav-menus.php
r32889 r32891 292 292 'taxonomyTermLabel' => __( 'Taxonomy' ), 293 293 'postTypeLabel' => __( 'Post Type' ), 294 'itemsFound' => __( 'Number of items found: %d' ), 295 'itemsFoundMore' => __( 'Additional items found: %d' ), 296 'itemsLoadingMore' => __( 'Loading more results... please wait.' ), 294 297 ), 295 298 'menuItemTransport' => 'postMessage', … … 624 627 <div class="accordion-section-title"> 625 628 <label class="screen-reader-text" for="menu-items-search"><?php _e( 'Search Menu Items' ); ?></label> 626 <input type="text" id="menu-items-search" placeholder="<?php esc_attr_e( 'Search menu items…' ) ?>" /> 629 <input type="text" id="menu-items-search" placeholder="<?php esc_attr_e( 'Search menu items…' ) ?>" aria-describedby="menu-items-search-desc" /> 630 <p class="screen-reader-text" id="menu-items-search-desc"><?php _e( 'The search results will be updated as you type.' ); ?></p> 627 631 <span class="spinner"></span> 628 632 </div>
Note: See TracChangeset
for help on using the changeset viewer.