File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1- import { $ } from 'meteor/jquery' ;
21import { Meteor } from 'meteor/meteor' ;
32import { AutoForm } from 'meteor/aldeed:autoform' ;
43import { 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
You can’t perform that action at this time.
0 commit comments