misskey/src/web/app/desktop/scripts/dialog.js

17 lines
422 B
JavaScript
Raw Normal View History

2017-02-18 09:42:17 +01:00
const riot = require('riot');
module.exports = (title, text, buttons, canThrough, onThrough) => {
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;
};