2018-09-01 13:47:49 +02:00
|
|
|
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);
|
2018-10-12 07:34:54 +02:00
|
|
|
if (opts.cb) vm.$once('closed', opts.cb);
|
2018-09-01 13:47:49 +02:00
|
|
|
document.body.appendChild(vm.$el);
|
|
|
|
(vm as any).focus();
|
|
|
|
};
|