summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/api/post.ts
blob: 5c0f0af8529665c5d90b8e5068ca21fe49296362 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import PostForm from '../views/components/post-form-dialog.vue';

export default (os) => (opts) => {
	const o = opts || {};

	document.documentElement.style.overflow = 'hidden';

	function recover() {
		document.documentElement.style.overflow = 'auto';
	}

	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();
};