This commit is contained in:
syuilo 2018-02-22 02:22:10 +09:00
parent 73029df58a
commit 0c092b8050
2 changed files with 21 additions and 13 deletions

View File

@ -1,9 +1,27 @@
import PostForm from '../views/components/post-form.vue';
import RepostForm from '../views/components/repost-form.vue';
//import RepostForm from '../views/components/repost-form.vue';
import getPostSummary from '../../../../common/get-post-summary';
export default function(opts) {
export default (os) => (opts) => {
const o = opts || {};
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);*/
const text = window.prompt(`${getPostSummary(o.repost)}」をRepost`);
if (text == null) return;
os.api('posts/create', {
repost_id: o.repost.id,
text: text == '' ? undefined : text
});
} else {
const app = document.getElementById('app');
app.style.display = 'none';
@ -11,16 +29,6 @@ export default function(opts) {
app.style.display = 'block';
}
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
@ -30,4 +38,4 @@ export default function(opts) {
vm.$once('post', recover);
document.body.appendChild(vm.$el);
}
}
};

View File

@ -38,7 +38,7 @@ init((launch) => {
chooseDriveFile,
dialog,
input,
post,
post: post(os),
notify
}));