ToolForm: More batch mode validation logic

This commit is contained in:
Aysam Guerler
2014-11-24 14:48:09 -05:00
parent b89ce4b3ce
commit 6bfe631f2f
6 changed files with 16 additions and 20 deletions
@@ -145,14 +145,12 @@ return Backbone.Model.extend({
}
// check number of inputs
if (n > 1) {
if (batch_n === -1) {
batch_n = n;
} else {
if (batch_n !== n) {
this._foundError(input_id, 'Please make sure that you select the same number or a single input for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + batch_n + '</b>.');
return false;
}
if (batch_n === -1) {
batch_n = n;
} else {
if (batch_n !== n) {
this._foundError(input_id, 'Please make sure that you select the same number of inputs for all batch mode fields. This field contains <b>' + n + '</b> selection(s) while a previous field contains <b>' + batch_n + '</b>.');
return false;
}
}
}
@@ -190,7 +190,7 @@ var View = Backbone.View.extend({
// prepare result dict
var result = {
batch : !this.options.multiple && (this.current == 'collection' || id_list.length > 1),
batch : !this.options.multiple && this.current != 'single',
values : []
}