home *** CD-ROM | disk | FTP | other *** search
/ HTML Examples / WP.iso / wordpress2 / wp-admin / js / language-chooser.js < prev    next >
Encoding:
Text File  |  2014-08-04  |  625 b   |  27 lines

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