summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/api/post.ts
blob: 15b2f6b69103dbac6e43a9bb33911675a58109c6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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();
};