diff -rupN filefield/filefield.js filefield_new/filefield.js --- filefield/filefield.js 2010-04-24 12:47:49.000000000 +1000 +++ filefield.js 2010-07-16 01:07:15.000000000 +1000 @@ -39,6 +39,7 @@ Drupal.behaviors.filefieldValidateAutoAt Drupal.behaviors.filefieldButtons = function(context) { $('input.form-submit', context).bind('mousedown', Drupal.filefield.disableFields); $('div.filefield-element input.form-submit', context).bind('mousedown', Drupal.filefield.progressBar); + $('div.filefield-element input.form-submit', context).bind('mousedown', Drupal.filefieldDisableSubmit); }; /** @@ -129,3 +130,17 @@ Drupal.filefield = { return false; } }; + +/** + * This disables all submit buttons while a file upload is in progress. + */ + +// Disable all submit buttons. +Drupal.filefieldDisableSubmit = function () { + $('input[type=submit]').attr('disabled', 'disabled').fadeTo(200, .20); +} + +// Enable all submit buttons. +Drupal.behaviors.filefieldEnableSubmit = function (context) { + $('input[type=submit]').removeAttr('disabled').fadeTo(200, 1); +}