From 5d3cca7781aa77e15623508257d29dd943b424f6 Mon Sep 17 00:00:00 2001 From: "S. Andrew Sheppard" Date: Tue, 22 Mar 2016 21:12:42 -0500 Subject: [PATCH] option to specify number of initial attachments --- js/wq/app.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/js/wq/app.js b/js/wq/app.js index fcefb2cf..9a494fa7 100644 --- a/js/wq/app.js +++ b/js/wq/app.js @@ -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) {