Skip to content
Snippets Groups Projects
Commit b08ed9cd authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

fixes #3471

Closes #3471

Merge request studip/studip!2366
parent dc56c9d9
No related branches found
No related tags found
No related merge requests found
...@@ -383,10 +383,10 @@ STUDIP.ready(function () { ...@@ -383,10 +383,10 @@ STUDIP.ready(function () {
observer.observe($(this).closest(':visible')[0], { observer.observe($(this).closest(':visible')[0], {
attributeOldValue: true, attributeOldValue: true,
attributes: true, attributes: true,
attributeFilter: ['style', 'class'], attributeFilter: ['style', 'class', 'hidden'],
characterData: false, characterData: false,
childList: true, childList: true,
subtree: false subtree: true
}); });
$(this).addClass('select2-awaiting'); $(this).addClass('select2-awaiting');
...@@ -394,12 +394,16 @@ STUDIP.ready(function () { ...@@ -394,12 +394,16 @@ STUDIP.ready(function () {
function onDomChange(mutations, observer) { function onDomChange(mutations, observer) {
mutations.forEach(function(mutation) { mutations.forEach(function(mutation) {
if ($('select.select2-awaiting', mutation.target).length > 0) { let targets = Array.from(mutation.target.querySelectorAll('select.select2-awaiting'));
$('select.select2-awaiting', mutation.target) if (mutation.target.matches('select.select2-awaiting')) {
.removeClass('select2-awaiting') targets.push(mutation.target);
.each(function() { }
createSelect2(this); targets = $(targets).filter(':visible');
});
if (targets.length > 0) {
targets.removeClass('select2-awaiting').each(function() {
createSelect2(this);
});
observer.disconnect(); observer.disconnect();
} }
}); });
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment