diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js index c99aabb58..0e5472477 100644 --- a/public/js/components/Bootstrap/Modal.js +++ b/public/js/components/Bootstrap/Modal.js @@ -46,11 +46,12 @@ export default { } }, mounted() { - this.modal = new bootstrap.Modal(this.$refs.modal, { - backdrop: this.backdrop, - focus: this.focus, - keyboard: this.keyboard - }); + if (this.$refs.modal) + this.modal = new bootstrap.Modal(this.$refs.modal, { + backdrop: this.backdrop, + focus: this.focus, + keyboard: this.keyboard + }); }, popup(body, options, title, footer) { const BsModal = this; @@ -80,8 +81,8 @@ export default { } }); const wrapper = document.createElement("div"); - instance.mount(wrapper); document.body.appendChild(wrapper); + instance.mount(wrapper); }); }, template: `