WordPress/wp-admin/js/language-chooser.js
Andrew Nacin 40258a41b8 Language chooser imporvements.
* Use a translated 'Continue' string.
 * Go back to using a select element.
 * Only show a spinner when we're installing a language. 

see #28577.

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


git-svn-id: http://core.svn.wordpress.org/trunk@29150 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-08-04 20:47:16 +00:00

27 lines
625 B
JavaScript

jQuery( function($) {
var select = $( '#language' ),
submit = $( '#language-continue' );
if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
return;
}
select.focus().on( 'change', function() {
var option = select.children( 'option:selected' );
submit.attr({
value: option.data( 'continue' ),
lang: option.attr( 'lang' )
});
});
$( 'form' ).submit( function() {
// Don't show a spinner for English and installed languages,
// as there is nothing to download.
if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
$( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );
}
});
});