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

fixes #3471

Closes #3471

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