aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap/vue.js
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2024-07-04 15:23:16 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2024-07-04 15:23:16 +0000
commitc8d06fae923e69ff015124975813fdc0ba924a08 (patch)
tree20c9099429ee05671f6bfaa88adb5f87d9c1ea33 /resources/assets/javascripts/bootstrap/vue.js
parenta9c40e363b3e13223bb771105c190be9475021a5 (diff)
refactor questionnaire editor to sfc, fixes #4303
Closes #4303 Merge request studip/studip!3155
Diffstat (limited to 'resources/assets/javascripts/bootstrap/vue.js')
-rw-r--r--resources/assets/javascripts/bootstrap/vue.js24
1 files changed, 23 insertions, 1 deletions
diff --git a/resources/assets/javascripts/bootstrap/vue.js b/resources/assets/javascripts/bootstrap/vue.js
index 64d2492..637241a 100644
--- a/resources/assets/javascripts/bootstrap/vue.js
+++ b/resources/assets/javascripts/bootstrap/vue.js
@@ -11,7 +11,29 @@ STUDIP.ready(() => {
let components = {};
config.components.forEach(component => {
const name = component.split('/').reverse()[0];
- components[name] = () => import(`../../../vue/components/${component}.vue`);
+ components[name] = () => {
+ // TODO: I wonder if this works with Vue3
+
+ const temp = import(`../../../vue/components/${component}.vue`);
+ temp.then(({default: c}) => {
+ const mounted = c.mounted ?? null;
+ c.mounted = function (...args) {
+ if (
+ this.$el instanceof Element
+ && this.$el.querySelector('[data-dialog-button]')
+ ) {
+ this.$el.closest('.studip-dialog')
+ .querySelector('.ui-dialog-buttonpane')
+ .remove();
+ }
+ if (mounted) {
+ mounted.call(this, args);
+ }
+ };
+ return c;
+ })
+ return temp;
+ };
});
STUDIP.Vue.load().then(async ({createApp, store}) => {