Sha256: 4e62d3c234960c6db34a546ef4b41e02a0b34bf47dc9ed47f1a6c8f5637bb7eb

Contents?: true

Size: 986 Bytes

Versions: 18

Compression:

Stored size: 986 Bytes

Contents

export class VClears {
    constructor(options, params, event, root) {
        this.target = options.target;
        this.ids = params.ids;
        this.event = event;
        this.root = root;
    }

    call(results) {
        const ids = this.ids;
        const root = this.root;
        return new Promise(function(resolve) {
            console.debug('Clearing');
            results.push({action: 'clears', statusCode: 200});
            for (const id of ids) {
                const elem = root.getElementById(id);
                if (elem && elem.vComponent && elem.vComponent.clear) {
                    elem.vComponent.clear();
                }
                else {
                    console.warn('Unable to clear element with id: ' + id +
                        '! Check to make sure you passed the correct id, and ' +
                        'that the control/input can be cleared.');
                }
            }
            resolve(results);
        });
    }
}

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
coprl-3.0.0.beta.12 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.11 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.10 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.9 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.8 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.7 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.6 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.5 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.1.2 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.4 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.3 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.2 views/mdc/assets/js/components/events/clears.js
coprl-3.0.0.beta.1 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.1.0 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.0.3 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.0.2 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.0.1 views/mdc/assets/js/components/events/clears.js
voom-presenters-2.0.0 views/mdc/assets/js/components/events/clears.js