You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

27 lines
625 B

  1. jQuery( function($) {
  2. var select = $( '#language' ),
  3. submit = $( '#language-continue' );
  4. if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) {
  5. return;
  6. }
  7. select.focus().on( 'change', function() {
  8. var option = select.children( 'option:selected' );
  9. submit.attr({
  10. value: option.data( 'continue' ),
  11. lang: option.attr( 'lang' )
  12. });
  13. });
  14. $( 'form' ).submit( function() {
  15. // Don't show a spinner for English and installed languages,
  16. // as there is nothing to download.
  17. if ( ! select.children( 'option:selected' ).data( 'installed' ) ) {
  18. $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' );
  19. }
  20. });
  21. });