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

fixes #3471

Closes #3471

Merge request !2366
parent 30752502
No related branches found
No related tags found
No related merge requests found
Pipeline #17528 passed
......@@ -257,24 +257,27 @@ STUDIP.ready(function () {
$('select.nested-select:not(:has(optgroup)):hidden:not(.select2-awaiting)').each(function() {
var observer = new window.MutationObserver(function(mutations) {
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();
observer = null;
}
});
});
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');
......
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