monkeeShark/src/client/app/desktop/api/dialog.ts
Zero King 1a91b6d03e Fix
2018-05-27 16:09:59 +00:00

18 lines
391 B
TypeScript

import OS from '../../mios';
import Dialog from '../views/components/dialog.vue';
export default (os: OS) => opts => {
return new Promise<string>((res, rej) => {
const o = opts || {};
const d = os.new(Dialog, {
title: o.title,
text: o.text,
modal: o.modal,
buttons: o.actions
});
d.$once('clicked', id => {
res(id);
});
document.body.appendChild(d.$el);
});
};