mirror of
https://github.com/kevinveenbirkenbach/homepage.veen.world.git
synced 2025-01-25 23:42:22 +01:00
Solved childrens selector bug
This commit is contained in:
parent
954cff051a
commit
0360c443b7
@ -74,12 +74,11 @@ function openDynamicPopup(subitem) {
|
||||
alternativesSection.classList.add('d-none');
|
||||
}
|
||||
|
||||
const childrenSection = document.createElement('div');
|
||||
childrenSection.classList.add('mt-4');
|
||||
childrenSection.innerHTML = `<h6>Options:</h6><ul class="list-group" id="dynamicChildrenList"></ul>`;
|
||||
|
||||
const childrenList = childrenSection.querySelector('#dynamicChildrenList');
|
||||
const childrenSection = document.getElementById('dynamicChildrenSection');
|
||||
const childrenList = document.getElementById('dynamicChildrenList');
|
||||
childrenList.innerHTML = '';
|
||||
if (subitem.children && subitem.children.length > 0) {
|
||||
childrenSection.classList.remove('d-none');
|
||||
subitem.children.forEach(child => {
|
||||
const listItem = document.createElement('li');
|
||||
listItem.classList.add('list-group-item', 'd-flex', 'justify-content-between', 'align-items-center');
|
||||
@ -93,6 +92,8 @@ function openDynamicPopup(subitem) {
|
||||
childrenList.appendChild(listItem);
|
||||
});
|
||||
document.querySelector('.modal-body').appendChild(childrenSection);
|
||||
} else {
|
||||
childrenSection.classList.add('d-none');
|
||||
}
|
||||
|
||||
const copyButton = document.getElementById('dynamicCopyButton');
|
||||
|
@ -25,6 +25,11 @@
|
||||
<div id="dynamicModalLink" class="mt-3 d-none">
|
||||
<a href="#" target="_blank" class="btn btn-primary w-100" id="dynamicModalLinkHref"></a>
|
||||
</div>
|
||||
<!-- Options -->
|
||||
<div id="dynamicChildrenSection" class="mt-4 d-none">
|
||||
<h6>Options:</h6>
|
||||
<ul class="list-group" id="dynamicChildrenList"></ul>
|
||||
</div>
|
||||
<!-- Alternativen -->
|
||||
<div id="dynamicAlternativesSection" class="mt-4 d-none">
|
||||
<h6>Alternatives:</h6>
|
||||
|
Loading…
x
Reference in New Issue
Block a user