2014-08-04 16:47:16 -04:00
|
|
|
jQuery( function($) {
|
2014-07-07 20:30:14 -04:00
|
|
|
|
2014-08-04 16:47:16 -04:00
|
|
|
var select = $( '#language' ),
|
|
|
|
submit = $( '#language-continue' );
|
2014-07-07 20:30:14 -04:00
|
|
|
|
2014-08-04 16:47:16 -04:00
|
|
|
if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
|
|
|
|
return;
|
|
|
|
}
|
2014-07-07 20:30:14 -04:00
|
|
|
|
2014-08-04 16:47:16 -04:00
|
|
|
select.focus().on( 'change', function() {
|
|
|
|
var option = select.children( 'option:selected' );
|
|
|
|
submit.attr({
|
|
|
|
value: option.data( 'continue' ),
|
|
|
|
lang: option.attr( 'lang' )
|
2014-07-07 20:30:14 -04:00
|
|
|
});
|
2014-08-04 16:47:16 -04:00
|
|
|
});
|
2014-07-07 20:30:14 -04:00
|
|
|
|
2014-08-04 16:47:16 -04:00
|
|
|
$( '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' );
|
|
|
|
}
|
|
|
|
});
|
2014-07-07 20:33:15 -04:00
|
|
|
|
2014-08-04 16:47:16 -04:00
|
|
|
});
|