upload-widget: Correct file input clearing.

Replacing file input doesn't work for value clearing. The best
way is to clean value directly, which excludes accidentally adding
wrong file after upload-widget validation error.
This commit is contained in:
K.Kanakhin 2017-03-16 22:05:39 +06:00 committed by Tim Abbott
parent 8ae35211b5
commit 831a467fa3
1 changed files with 1 additions and 2 deletions

View File

@ -39,8 +39,7 @@ var upload_widget = (function () {
function clear() {
var control = get_file_input();
var new_control = control.clone(true);
control.replaceWith(new_control);
control.val('');
file_name_field.text('');
clear_button.hide();
upload_button.show();