views/mdc/assets/js/components/events/base.js in voom-presenters-0.1.13 vs views/mdc/assets/js/components/events/base.js in voom-presenters-0.2.0
- old
+ new
@@ -15,13 +15,23 @@
return document.getElementById(this.options.__parent_id__);
}
inputValues(form) {
let params = [];
- // Let input component push parameters
+
+ // If tagged input is asked for. Fetch all the matching tag elements and then call any bound components
+ if (this.options.input_tag !== undefined) {
+ var taggedInputs = document.querySelectorAll('[data-input-tag=' + this.options.input_tag + ']');
+ for (let input of taggedInputs) {
+ if (input.vComponent && typeof input.vComponent.prepareSubmit === 'function') {
+ input.vComponent.prepareSubmit(params);
+ }
+ }
+ }
+ // Let input components push parameters
let vComp = this.component();
- if (vComp) {
- vComp.prepareSubmit(form, params);
+ if (vComp && typeof vComp.prepareSubmit === 'function') {
+ vComp.prepareSubmit(params);
}
return params;
}
component() {