Refactor
This commit is contained in:
parent
dded76099c
commit
9b253ccb3a
6 changed files with 27 additions and 54 deletions
|
|
@ -6,13 +6,17 @@ export default (os: OS) => opts => {
|
|||
const o = opts || {};
|
||||
if (o.renote) {
|
||||
const vm = os.new(RenoteFormWindow, {
|
||||
note: o.renote
|
||||
note: o.renote,
|
||||
animation: o.animation == null ? true : o.animation
|
||||
});
|
||||
if (opts.cb) vm.$once('closed', opts.cb);
|
||||
document.body.appendChild(vm.$el);
|
||||
} else {
|
||||
const vm = os.new(PostFormWindow, {
|
||||
reply: o.reply
|
||||
reply: o.reply,
|
||||
animation: o.animation == null ? true : o.animation
|
||||
});
|
||||
if (opts.cb) vm.$once('closed', opts.cb);
|
||||
document.body.appendChild(vm.$el);
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -82,22 +82,6 @@ export default Vue.extend({
|
|||
type: Object,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
reply(viaKeyboard = false) {
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.appearNote,
|
||||
animation: !viaKeyboard
|
||||
}).$once('closed', this.focus);
|
||||
},
|
||||
|
||||
renote(viaKeyboard = false) {
|
||||
(this as any).os.new(MkRenoteFormWindow, {
|
||||
note: this.appearNote,
|
||||
animation: !viaKeyboard
|
||||
}).$once('closed', this.focus);
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -98,22 +98,6 @@ export default Vue.extend({
|
|||
required: false,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
reply(viaKeyboard = false) {
|
||||
(this as any).os.new(MkPostFormWindow, {
|
||||
reply: this.appearNote,
|
||||
animation: !viaKeyboard
|
||||
}).$once('closed', this.focus);
|
||||
},
|
||||
|
||||
renote(viaKeyboard = false) {
|
||||
(this as any).os.new(MkRenoteFormWindow, {
|
||||
note: this.appearNote,
|
||||
animation: !viaKeyboard
|
||||
}).$once('closed', this.focus);
|
||||
},
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue