diff --git a/app/static/js/modal.js b/app/static/js/modal.js index 4120fe8..057e1db 100644 --- a/app/static/js/modal.js +++ b/app/static/js/modal.js @@ -74,12 +74,11 @@ function openDynamicPopup(subitem) { alternativesSection.classList.add('d-none'); } - const childrenSection = document.createElement('div'); - childrenSection.classList.add('mt-4'); - childrenSection.innerHTML = `
Options:
`; - - 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'); diff --git a/app/templates/moduls/modal.html.j2 b/app/templates/moduls/modal.html.j2 index b7fac4a..927921e 100644 --- a/app/templates/moduls/modal.html.j2 +++ b/app/templates/moduls/modal.html.j2 @@ -25,6 +25,11 @@ + +
+
Options:
+ +
Alternatives: