Commit 75d87ee9 authored by David Barchiesi's avatar David Barchiesi

Add class change listener for showing collapse/expand icon in Unmaintained applications section.

parent fe900e1b
Pipeline #24145 passed with stage
in 6 minutes and 44 seconds
...@@ -73,3 +73,29 @@ if (search) { ...@@ -73,3 +73,29 @@ if (search) {
}); });
}); });
} }
const unmaintainedCollapsible = document.getElementById('unmaintained-collapse-link');
if (unmaintainedCollapsible) {
var observer = new MutationObserver(function(mutations) {
for (let mutation of mutations) {
if (mutation.type === 'attributes') {
const icon = unmaintainedCollapsible.querySelector('i');
if (!mutation.oldValue) {
icon.classList.add('icon_expand-all');
icon.classList.remove('icon_collapse-all');
} else if (mutation.oldValue === "collapsed") {
icon.classList.add('icon_collapse-all');
icon.classList.remove('icon_expand-all');
}
}
}
});
observer.observe(unmaintainedCollapsible, {
attributes: true,
attributeFilter: ['class'],
attributeOldValue: true,
childList: false,
characterData: false
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment