misskey/src/web/app/desktop/scripts/dialog.js
syuilo 45e8331e26 🍣
Closes #12, #227 and #58
2017-03-18 20:05:11 +09:00

16 lines
420 B
JavaScript

import * as riot from 'riot';
export default (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;
};