diff --git a/public/js/components/Bootstrap/Modal.js b/public/js/components/Bootstrap/Modal.js index 18adf96d2..734a3bdb9 100755 --- a/public/js/components/Bootstrap/Modal.js +++ b/public/js/components/Bootstrap/Modal.js @@ -68,6 +68,13 @@ export default { slots.title = () => title; if (footer !== undefined) slots.footer = () => footer; + + // little hack to check whether primevue is included in the app or not + let includedPrimevue = false; + if(typeof primevue !== 'undefined'){ + includedPrimevue = true; + } + return new Promise((resolve,reject) => { const instance = Vue.createApp({ setup() { @@ -80,6 +87,7 @@ export default { }, mounted() { this.$refs.modal.show(); + }, beforeUnmount() { if (this.$refs.modal) @@ -90,8 +98,12 @@ export default { } }); const wrapper = document.createElement("div"); - if (primevue) + + // if(primevue) --> won't work because primevue is not defined in this scope and promise would be rejected + if (includedPrimevue){ instance.use(primevue.config.default, {zIndex: {overlay: 9999}}) + } + instance.use(Phrasen); // TODO(chris): find a more dynamic way instance.mount(wrapper); document.body.appendChild(wrapper);