Re-enable a .wp-upload-form submit button whenever any file input in that form has a file selected, to minimize the potential for issues. props kovshenin. fixes #20855. see [22459].

git-svn-id: https://develop.svn.wordpress.org/trunk@22663 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2012-11-19 06:07:04 +00:00
parent 16ef935110
commit f01d10e9ac
2 changed files with 5 additions and 2 deletions

View File

@ -402,8 +402,11 @@ $(document).ready( function() {
return;
button = form.find('input[type="submit"]');
input = form.find('input[type="file"]');
function toggleUploadButton() {
button.prop('disabled', '' === input.val());
button.prop('disabled', '' === input.map( function() {
return $(this).val();
}).get().join(''));
}
toggleUploadButton();
input.on('change', toggleUploadButton);

View File

@ -87,7 +87,7 @@ if ( isset($_GET['inline']) ) {
require_once('./admin-header.php');
$form_class = 'media-upload-form type-form validate';
$form_class = 'media-upload-form wp-upload-form type-form validate';
if ( get_user_setting('uploader') )
$form_class .= ' html-uploader';