Docs: Improve JSDoc for `language-chooser.js`.

Props ireneyoast, manuelaugustin.
Fixes #43950.

Built from https://develop.svn.wordpress.org/trunk@43334


git-svn-id: http://core.svn.wordpress.org/trunk@43162 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
atimmer 2018-06-28 02:24:43 +00:00
parent 7c410b8d37
commit 8a9dc11590
2 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,8 @@
jQuery( function($) {
/*
* Set the correct translation to the continue button and show a spinner
* when downloading a language.
*/
var select = $( '#language' ),
submit = $( '#language-continue' );
@ -8,6 +11,10 @@ if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
}
select.focus().on( 'change', function() {
/*
* When a language is selected, set matching translation to continue button
* and attach the language attribute.
*/
var option = select.children( 'option:selected' );
submit.attr({
value: option.data( 'continue' ),
@ -16,8 +23,7 @@ select.focus().on( 'change', function() {
});
$( 'form' ).submit( function() {
// Don't show a spinner for English and installed languages,
// as there is nothing to download.
// Show spinner for languages that need to be downloaded.
if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
$( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );
}

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-43333';
$wp_version = '5.0-alpha-43334';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.