Accessibility: Improve the Dashboard Nearby Events widget `wp.a11y.speak()` messages.

Avoids to announce the "city updated" message on page load.

Fixes #42037.


git-svn-id: https://develop.svn.wordpress.org/trunk@41682 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrea Fercia 2017-10-02 19:24:24 +00:00
parent 93fc60f36a
commit 54153520f2
1 changed files with 4 additions and 1 deletions

View File

@ -425,7 +425,10 @@ jQuery( function( $ ) {
template = wp.template( 'community-events-no-upcoming-events' );
$results.html( template( templateParams ) );
}
wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' );
if ( 'user' === initiatedBy ) {
wp.a11y.speak( communityEventsData.l10n.city_updated.replace( l10nPlaceholder, templateParams.location.description ), 'assertive' );
}
elementVisibility['#community-events-location-message'] = true;
elementVisibility['.community-events-toggle-location'] = true;