misskey/src/web/app/desktop/scripts/dialog.ts
2017-11-13 18:05:35 +09:00

17 lines
431 B
TypeScript

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 as any).mount(dialog, {
controller: controller,
title: title,
text: text,
buttons: buttons,
canThrough: canThrough,
onThrough: onThrough
});
controller.trigger('open');
return controller;
};