mirror of
https://github.com/misskey-dev/misskey
synced 2024-12-19 09:08:31 +09:00
20 lines
459 B
TypeScript
20 lines
459 B
TypeScript
import OS from '../../mios';
|
|
import InputDialog from '../views/components/input-dialog.vue';
|
|
|
|
export default (os: OS) => opts => {
|
|
return new Promise<string>((res, rej) => {
|
|
const o = opts || {};
|
|
const d = os.new(InputDialog, {
|
|
title: o.title,
|
|
placeholder: o.placeholder,
|
|
default: o.default,
|
|
type: o.type || 'text',
|
|
allowEmpty: o.allowEmpty
|
|
});
|
|
d.$once('done', text => {
|
|
res(text);
|
|
});
|
|
document.body.appendChild(d.$el);
|
|
});
|
|
};
|