2018-02-22 02:15:46 +09:00
|
|
|
import PostForm from '../views/components/post-form.vue';
|
|
|
|
import RepostForm from '../views/components/repost-form.vue';
|
|
|
|
|
|
|
|
export default function(opts) {
|
|
|
|
const o = opts || {};
|
2018-02-22 02:00:30 +09:00
|
|
|
|
|
|
|
const app = document.getElementById('app');
|
|
|
|
app.style.display = 'none';
|
|
|
|
|
|
|
|
function recover() {
|
|
|
|
app.style.display = 'block';
|
|
|
|
}
|
|
|
|
|
2018-02-22 02:15:46 +09:00
|
|
|
if (o.repost) {
|
|
|
|
const vm = new RepostForm({
|
|
|
|
propsData: {
|
|
|
|
repost: o.repost
|
|
|
|
}
|
|
|
|
}).$mount();
|
|
|
|
vm.$once('cancel', recover);
|
|
|
|
vm.$once('post', recover);
|
|
|
|
document.body.appendChild(vm.$el);
|
|
|
|
} else {
|
|
|
|
const vm = new PostForm({
|
|
|
|
propsData: {
|
|
|
|
reply: o.reply
|
|
|
|
}
|
|
|
|
}).$mount();
|
|
|
|
vm.$once('cancel', recover);
|
|
|
|
vm.$once('post', recover);
|
|
|
|
document.body.appendChild(vm.$el);
|
|
|
|
}
|
|
|
|
}
|