diff options
Diffstat (limited to 'resources/assets/javascripts')
| -rw-r--r-- | resources/assets/javascripts/bootstrap/settings.js | 49 | ||||
| -rw-r--r-- | resources/assets/javascripts/bootstrap/vue.js | 10 |
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()); + } }); }); |
