Ticket #40735: 40735-form-ux.diff
| File 40735-form-ux.diff, 1.7 KB (added by , 9 years ago) |
|---|
-
src/wp-admin/js/dashboard.js
380 380 template = wp.template( 'community-events-no-upcoming-events' ); 381 381 $results.html( template( templateParams ) ); 382 382 } 383 wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location ));383 wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' ); 384 384 385 385 elementVisibility['#community-events-location-message'] = true; 386 386 elementVisibility['.community-events-toggle-location'] = true; … … 420 420 421 421 $( '.community-events-toggle-location' ).attr( 'aria-expanded', elementVisibility['.community-events-toggle-location'] ); 422 422 423 /* 424 * During the initial page load, the location form should be hidden 425 * by default if the user has saved a valid location during a previous 426 * session. It's safe to assume that they want to continue using that 427 * location, and displaying the form would unnecessarily clutter the 428 * widget. 429 */ 430 if ( 'app' === initiatedBy && templateParams.location ) { 423 if ( templateParams.location ) { 424 // Hide the form when there's a valid location. 431 425 app.toggleLocationForm( 'hide' ); 426 427 if ( 'user' === initiatedBy ) { 428 // When the form is programmatically hidden after a user search, bring the focus back to the toggle 429 // button so users relying on screen readers don't lose their place. 430 $( '.community-events-toggle-location' ).focus(); 431 } 432 432 } else { 433 433 app.toggleLocationForm( 'show' ); 434 434 }