Sha256: 1ddb2a0e6e3ced13948259858bb07e606f9f23014336e364e68629c859c0f0c9

Contents?: true

Size: 794 Bytes

Versions: 15

Compression:

Stored size: 794 Bytes

Contents

export class VDialog {
    constructor(options, params, event) {
        this.dialogId = options.target;
        this.params = params;
        this.event = event;
    }

    call(results) {
        var dialog = document.querySelector('#' + this.dialogId);
        if(dialog) {
            if (!dialog.showModal) {
                dialogPolyfill.registerDialog(dialog);
            }

            dialog.showModal();
        }else {
            console.error("Unable to find dialog with id: "+this.dialogId+". Usually this means you forgot to attach it to the currently rendered page.");
        }
        var promiseObj = new Promise(function (resolve) {
            results.push({action:'dialog', statusCode: 200});
            resolve(results);
        });
        return promiseObj;
    }
}

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
voom-presenters-0.2.0 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.13 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.12 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.11 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.10 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.9 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.8 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.7 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.6 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.5 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.4 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.3 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.2 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.1 views/mdc/assets/js/components/events/dialog.js
voom-presenters-0.1.0 views/mdc/assets/js/components/events/dialog.js