equal
deleted
inserted
replaced
12 |
12 |
13 if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) { |
13 if ( ! $( 'body' ).hasClass( 'language-chooser' ) ) { |
14 return; |
14 return; |
15 } |
15 } |
16 |
16 |
17 select.focus().on( 'change', function() { |
17 select.trigger( 'focus' ).on( 'change', function() { |
18 /* |
18 /* |
19 * When a language is selected, set matching translation to continue button |
19 * When a language is selected, set matching translation to continue button |
20 * and attach the language attribute. |
20 * and attach the language attribute. |
21 */ |
21 */ |
22 var option = select.children( 'option:selected' ); |
22 var option = select.children( 'option:selected' ); |
24 value: option.data( 'continue' ), |
24 value: option.data( 'continue' ), |
25 lang: option.attr( 'lang' ) |
25 lang: option.attr( 'lang' ) |
26 }); |
26 }); |
27 }); |
27 }); |
28 |
28 |
29 $( 'form' ).submit( function() { |
29 $( 'form' ).on( 'submit', function() { |
30 // Show spinner for languages that need to be downloaded. |
30 // Show spinner for languages that need to be downloaded. |
31 if ( ! select.children( 'option:selected' ).data( 'installed' ) ) { |
31 if ( ! select.children( 'option:selected' ).data( 'installed' ) ) { |
32 $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' ); |
32 $( this ).find( '.step .spinner' ).css( 'visibility', 'visible' ); |
33 } |
33 } |
34 }); |
34 }); |