Skip to content

Commit

Permalink
option to specify number of initial attachments
Browse files Browse the repository at this point in the history
  • Loading branch information
sheppard committed Mar 23, 2016
1 parent 9f8510a commit 5d3cca7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions js/wq/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -1370,6 +1370,13 @@ function _default_attachments(field, context) {
if (!field.initial) {
return Promise.resolve([]);
}
if (typeof field.initial == 'string' || typeof field.initial == 'number') {
var attachments = [];
for (var i = 0; i < +field.initial; i++) {
attachments.push({'@index': i});
}
return Promise.resolve(attachments);
}
var typeField;
field.children.forEach(function(tf) {
if (tf.name == field.initial.type_field) {
Expand Down

0 comments on commit 5d3cca7

Please sign in to comment.