tomitrescak / meteor-uploads

MIT License
295 stars 41 forks source link

Reactive fileTypes #160

Closed chongwang87 closed 8 years ago

chongwang87 commented 9 years ago

Is it possible to make fileTypes reactive?

Example usage:

Template

{{> upload_bootstrap fileTypes=fileTypes multiple=true}}

Template helper

fileTypes: function(){
    var instance = Template.instance();
    return instance.uploadFileType;
}

Template event from a dropdown selection

'change #uploadFileTypes': function(e,t){
    var instance = Template.instance(),
        val = $(e.target).val(); // 'application/pdf' or 'image/*'
    instance.uploadFileType = val;
}
tomitrescak commented 9 years ago

Hi, well, this is a very custom behaviour. If you need, just fork the package and add it. I would consider a PR if it won't bloat the package too much.