Skip to content

Commit 3b94ee3

Browse files
committed
Minor fixes
1 parent 61ec125 commit 3b94ee3

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/client/fileUpload.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { $ } from 'meteor/jquery';
21
import { Meteor } from 'meteor/meteor';
32
import { AutoForm } from 'meteor/aldeed:autoform';
43
import { Template } from 'meteor/templating';
@@ -48,8 +47,10 @@ Template.afFileUpload.helpers({
4847
},
4948
uploadedFile() {
5049
const template = Template.instance();
51-
var _id = template.fileId.get() || this.value;
52-
if (typeof _id !== 'string' || _id.length === 0) return null;
50+
const _id = template.fileId.get() || this.value;
51+
if (typeof _id !== 'string' || _id.length === 0) {
52+
return null;
53+
}
5354
return template.collection.findOne({_id:_id});
5455
}
5556
});
@@ -89,7 +90,7 @@ Template.afFileUpload.events({
8990
upload.on('error', function (error) {
9091
ctx.reset();
9192
ctx.addValidationErrors([{name: template.inputName, type: 'uploadError', value: error.reason}]);
92-
$(e.currentTarget).val('');
93+
template.$(e.currentTarget).val('');
9394
return;
9495
});
9596

0 commit comments

Comments
 (0)