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