aboutsummaryrefslogtreecommitdiff
path: root/resources/assets/javascripts/bootstrap
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2025-02-27 15:43:55 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2025-02-27 15:43:55 +0000
commit8ba78ce50c8cf61ad2df91ffaa19952bb5f4fff9 (patch)
tree6bc5d5674cc9905a9e190fab21b7270b564d80c0 /resources/assets/javascripts/bootstrap
parent257f38c62b0847f76fc477c6e014c5d2a0a5bf54 (diff)
replace old colour group selector and notifications with vue app that uses the same underlying data as my courses, relocate my courses vue components and remove now obsolete functions from meine_seminare_func, fixes #5165, fixes #5201
Closes #5165 and #5201 Merge request studip/studip!3892
Diffstat (limited to 'resources/assets/javascripts/bootstrap')
-rw-r--r--resources/assets/javascripts/bootstrap/settings.js49
-rw-r--r--resources/assets/javascripts/bootstrap/vue.js10
2 files changed, 9 insertions, 50 deletions
diff --git a/resources/assets/javascripts/bootstrap/settings.js b/resources/assets/javascripts/bootstrap/settings.js
index caae5b2..2acaabe 100644
--- a/resources/assets/javascripts/bootstrap/settings.js
+++ b/resources/assets/javascripts/bootstrap/settings.js
@@ -32,55 +32,6 @@ STUDIP.domReady(() => {
});
});
-//
-$(document).on('change', '#settings-notifications :checkbox', function() {
- var name = $(this).attr('name');
-
- if (name === 'all[all]') {
- $(this)
- .closest('table')
- .find(':checkbox')
- .prop('checked', this.checked);
- return;
- }
-
- if (/all\[columns\]/.test(name)) {
- var index =
- $(this)
- .closest('td')
- .index() + 2;
- $(this)
- .closest('table')
- .find('tbody td:nth-child(' + index + ') :checkbox')
- .prop('checked', this.checked);
- } else if (/all\[rows\]/.test(name)) {
- $(this)
- .closest('td')
- .siblings()
- .find(':checkbox')
- .prop('checked', this.checked);
- }
-
- $('.notification.settings tbody :checkbox[name^=all]').each(function() {
- var other = $(this)
- .closest('td')
- .siblings()
- .find(':checkbox');
- this.checked = other.filter(':not(:checked)').length === 0;
- });
-
- $('.notification.settings thead :checkbox').each(function() {
- var index =
- $(this)
- .closest('td')
- .index() + 2,
- other = $(this)
- .closest('table')
- .find('tbody td:nth-child(' + index + ') :checkbox');
- this.checked = other.filter(':not(:checked)').length === 0;
- });
-});
-
$(document).on('input', '#new_password', function() {
var message = $(this).data().message;
if (this.validity.patternMismatch) {
diff --git a/resources/assets/javascripts/bootstrap/vue.js b/resources/assets/javascripts/bootstrap/vue.js
index c0fe942..ac22629 100644
--- a/resources/assets/javascripts/bootstrap/vue.js
+++ b/resources/assets/javascripts/bootstrap/vue.js
@@ -46,9 +46,12 @@ STUDIP.ready(() => {
const promises = [Promise.resolve()];
for (const [index, name] of Object.entries(config.stores)) {
+
promises.push(
import(`../../../vue/store/${name}.js`).then(storeConfig => {
- store.registerModule(index, storeConfig.default);
+ if (!store.hasModule(index)) {
+ store.registerModule(index, storeConfig.default);
+ }
const dataElement = document.getElementById(`vue-store-data-${index}`);
if (dataElement) {
@@ -106,5 +109,10 @@ STUDIP.ready(() => {
plugins.forEach(plugin => app.use(plugin, { store }))
app.mount(node);
+
+ const dialog = node.closest('.studip-dialog');
+ if (dialog !== null) {
+ $(dialog).on('dialogclose', () => app.unmount());
+ }
});
});