From a14e4f1c869d6ebdeaa1618f0746b0c555fdd9ab Mon Sep 17 00:00:00 2001 From: Anton Timmermans Date: Thu, 7 Jun 2018 15:07:31 +0000 Subject: [PATCH] Docs: Improve JSDoc for `language-chooser.js`. Props ireneyoast, manuelaugustin. Fixes #43950. git-svn-id: https://develop.svn.wordpress.org/trunk@43334 602fd350-edb4-49c9-b593-d223f7449a82 --- src/js/_enqueues/lib/language-chooser.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/js/_enqueues/lib/language-chooser.js b/src/js/_enqueues/lib/language-chooser.js index 628b8a81fb..9ca3ea679a 100644 --- a/src/js/_enqueues/lib/language-chooser.js +++ b/src/js/_enqueues/lib/language-chooser.js @@ -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' ); }