Sharkey/src/client/app/mobile/api/post.ts

25 lines
486 B
TypeScript
Raw Normal View History

2018-02-21 19:15:46 +02:00
import PostForm from '../views/components/post-form.vue';
2018-02-21 19:22:10 +02:00
export default (os) => (opts) => {
2018-02-21 19:15:46 +02:00
const o = opts || {};
2018-02-21 19:00:30 +02:00
2018-05-18 00:27:27 +03:00
const app = document.getElementById('app');
app.style.display = 'none';
2018-02-21 19:22:10 +02:00
2018-05-18 00:27:27 +03:00
function recover() {
app.style.display = 'block';
}
2018-02-21 19:22:10 +02:00
2018-05-18 00:27:27 +03:00
const vm = new PostForm({
parent: os.app,
propsData: {
reply: o.reply,
renote: o.renote
2018-02-21 19:22:10 +02:00
}
2018-05-18 00:27:27 +03:00
}).$mount();
vm.$once('cancel', recover);
vm.$once('note', recover);
document.body.appendChild(vm.$el);
(vm as any).focus();
2018-02-21 19:22:10 +02:00
};