1
0
forked from mirror/misskey
mi.moris.day/src/web/app/desktop/scripts/dialog.ts

17 lines
431 B
TypeScript
Raw Normal View History

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