authorize.js 968 B

123456789101112131415161718192021222324252627
  1. /**
  2. * @file
  3. * Conditionally hide or show the appropriate settings and saved defaults
  4. * on the file transfer connection settings form used by authorize.php.
  5. */
  6. (function ($) {
  7. Drupal.behaviors.authorizeFileTransferForm = {
  8. attach: function(context) {
  9. $('#edit-connection-settings-authorize-filetransfer-default').change(function() {
  10. $('.filetransfer').hide().filter('.filetransfer-' + $(this).val()).show();
  11. });
  12. $('.filetransfer').hide().filter('.filetransfer-' + $('#edit-connection-settings-authorize-filetransfer-default').val()).show();
  13. // Removes the float on the select box (used for non-JS interface).
  14. if ($('.connection-settings-update-filetransfer-default-wrapper').length > 0) {
  15. $('.connection-settings-update-filetransfer-default-wrapper').css('float', 'none');
  16. }
  17. // Hides the submit button for non-js users.
  18. $('#edit-submit-connection').hide();
  19. $('#edit-submit-process').show();
  20. }
  21. };
  22. })(jQuery);