jormungandr-bite/src/web/app/desktop/scripts/dialog.js

17 lines
420 B
JavaScript
Raw Normal View History

2017-03-18 05:05:11 -06:00
import * as riot from 'riot';
2017-02-18 01:42:17 -07:00
2017-03-18 05:05:11 -06:00
export default (title, text, buttons, canThrough, onThrough) => {
2017-02-18 01:42:17 -07:00
const dialog = document.body.appendChild(document.createElement('mk-dialog'));
const controller = riot.observable();
riot.mount(dialog, {
controller: controller,
title: title,
text: text,
buttons: buttons,
canThrough: canThrough,
onThrough: onThrough
});
controller.trigger('open');
return controller;
};