mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Reset input
This commit is contained in:
@@ -37,7 +37,8 @@ angular
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var files = document.getElementById('file').files;
|
var fileEl = document.getElementById('file');
|
||||||
|
var files = fileEl.files;
|
||||||
if (!files || !files.length) {
|
if (!files || !files.length) {
|
||||||
toastr.error(i18nService.selectFile, i18nService.errorsOccurred);
|
toastr.error(i18nService.selectFile, i18nService.errorsOccurred);
|
||||||
return;
|
return;
|
||||||
@@ -54,6 +55,12 @@ angular
|
|||||||
});
|
});
|
||||||
$analytics.eventTrack('Added Attachment');
|
$analytics.eventTrack('Added Attachment');
|
||||||
toastr.success(i18nService.attachmentSaved);
|
toastr.success(i18nService.attachmentSaved);
|
||||||
|
|
||||||
|
// reset file input
|
||||||
|
// ref: https://stackoverflow.com/a/20552042
|
||||||
|
fileEl.type = '';
|
||||||
|
fileEl.type = 'file';
|
||||||
|
fileEl.value = '';
|
||||||
}, function (err) {
|
}, function (err) {
|
||||||
if (err) {
|
if (err) {
|
||||||
toastr.error(err);
|
toastr.error(err);
|
||||||
|
|||||||
Reference in New Issue
Block a user