rudeshark.net/src/client/app/mobile/api/post.ts
2018-06-16 19:45:29 +09:00

25 lines
488 B
TypeScript

import PostForm from '../views/components/post-form.vue';
export default (os) => (opts) => {
const o = opts || {};
const app = document.getElementById('app');
app.style.display = 'none';
function recover() {
app.style.display = 'block';
}
const vm = new PostForm({
parent: os.app,
propsData: {
reply: o.reply,
renote: o.renote
}
}).$mount();
vm.$once('cancel', recover);
vm.$once('posted', recover);
document.body.appendChild(vm.$el);
(vm as any).focus();
};