|
1 | | -import { _ } from 'meteor/underscore'; |
2 | 1 | import { Meteor } from 'meteor/meteor'; |
3 | 2 | import { AutoForm } from 'meteor/aldeed:autoform'; |
4 | 3 | import { Template } from 'meteor/templating'; |
@@ -52,15 +51,19 @@ Template.afFileUpload.onCreated(function () { |
52 | 51 | this.uploadTemplate = this.data.atts.uploadTemplate || null; |
53 | 52 | this.previewTemplate = this.data.atts.previewTemplate || null; |
54 | 53 | this.accept = this.data.atts.accept || null; |
55 | | - this.insertConfig = Object.assign({}, this.data.atts.insertConfig || {}); |
| 54 | + this.insertConfig = Object.assign({}, defaultInsertOpts, this.data.atts.insertConfig || {}); |
56 | 55 | delete this.data.atts.insertConfig; |
57 | | - this.insertConfig = Object.assign(this.insertConfig, _.pick(this.data.atts, Object.keys(defaultInsertOpts))); |
58 | 56 |
|
59 | | - if (!isNaN(this.insertConfig.streams) || this.insertConfig.streams !== 'dynamic') { |
| 57 | + if (!isNaN(this.insertConfig.streams)) { |
60 | 58 | this.insertConfig.streams = parseInt(this.insertConfig.streams); |
| 59 | + } else if (this.insertConfig.streams !== 'dynamic') { |
| 60 | + this.insertConfig.streams = 'dynamic'; |
61 | 61 | } |
62 | | - if (!isNaN(this.insertConfig.chunkSize) || this.insertConfig.chunkSize !== 'dynamic') { |
| 62 | + |
| 63 | + if (!isNaN(this.insertConfig.chunkSize)) { |
63 | 64 | this.insertConfig.chunkSize = parseInt(this.insertConfig.chunkSize); |
| 65 | + } else if (this.insertConfig.chunkSize !== 'dynamic') { |
| 66 | + this.insertConfig.chunkSize = 'dynamic'; |
64 | 67 | } |
65 | 68 |
|
66 | 69 | this.collectionName = function () { |
|
0 commit comments