Sha256: cdd3076470f0849f5d1afe6b6c09623eee94ae3f8a2575ea9cc60f3c7fdcf1f2

Contents?: true

Size: 892 Bytes

Versions: 8

Compression:

Stored size: 892 Bytes

Contents

import {VErrors} from './errors';
import {VUrls} from '../../utils/urls';

export class VBase extends VUrls {
    constructor(options) {
        super();
        this.options = options;
    }

    clearErrors() {
        new VErrors().clearErrors();
    }

    parentElement() {
        return document.getElementById(this.options.__parent_id__);
    }

    inputValues(form) {
        let params = [];
        // Let input component push parameters
        let vComp = this.component();
        if (vComp) {
            vComp.prepareSubmit(form, params);
        }
        return params;
    }

    component() {
        let parent = this.parentElement();
        return parent ? parent.vComponent : null;
    }

    validate() {
        let errors = [];
        let comp = this.component();
        if (comp) {
            errors = comp.validate();
        }
        return errors;
    }
}

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
voom-presenters-0.1.13 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.12 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.11 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.10 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.9 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.8 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.7 views/mdc/assets/js/components/events/base.js
voom-presenters-0.1.6 views/mdc/assets/js/components/events/base.js