diff --git a/app/static/js/modal.js b/app/static/js/modal.js index 911144d..4120fe8 100644 --- a/app/static/js/modal.js +++ b/app/static/js/modal.js @@ -1,8 +1,5 @@ function openDynamicPopup(subitem) { - // Schließe alle offenen Modals closeAllModals(); - - // Setze den Titel mit Icon, falls vorhanden const modalTitle = document.getElementById('dynamicModalLabel'); if (subitem.icon && subitem.icon.class) { modalTitle.innerHTML = ` ${subitem.name}`; @@ -10,7 +7,6 @@ function openDynamicPopup(subitem) { modalTitle.innerText = subitem.name; } - // Setze den Identifier, falls vorhanden const identifierBox = document.getElementById('dynamicIdentifierBox'); const modalContent = document.getElementById('dynamicModalContent'); if (subitem.identifier) { @@ -21,7 +17,6 @@ function openDynamicPopup(subitem) { modalContent.value = ''; } - // Konfiguriere die Warnbox mit Markdown const warningBox = document.getElementById('dynamicModalWarning'); if (subitem.warning) { warningBox.classList.remove('d-none'); @@ -30,7 +25,6 @@ function openDynamicPopup(subitem) { warningBox.classList.add('d-none'); } - // Konfiguriere die Infobox mit Markdown const infoBox = document.getElementById('dynamicModalInfo'); if (subitem.info) { infoBox.classList.remove('d-none'); @@ -39,7 +33,6 @@ function openDynamicPopup(subitem) { infoBox.classList.add('d-none'); } - // Zeige die Beschreibung, falls keine URL vorhanden ist const descriptionText = document.getElementById('dynamicDescriptionText'); if (!subitem.url && subitem.description) { descriptionText.classList.remove('d-none'); @@ -49,7 +42,6 @@ function openDynamicPopup(subitem) { descriptionText.innerText = ''; } - // Konfiguriere den Link oder die Beschreibung const linkBox = document.getElementById('dynamicModalLink'); const linkHref = document.getElementById('dynamicModalLinkHref'); if (subitem.url) { @@ -61,10 +53,9 @@ function openDynamicPopup(subitem) { linkHref.href = '#'; } - // Konfiguriere die Alternativen const alternativesSection = document.getElementById('dynamicAlternativesSection'); const alternativesList = document.getElementById('dynamicAlternativesList'); - alternativesList.innerHTML = ''; // Clear existing alternatives + alternativesList.innerHTML = ''; if (subitem.alternatives && subitem.alternatives.length > 0) { alternativesSection.classList.remove('d-none'); subitem.alternatives.forEach(alt => { @@ -83,7 +74,27 @@ function openDynamicPopup(subitem) { alternativesSection.classList.add('d-none'); } - // Kopierfunktion für den Identifier + const childrenSection = document.createElement('div'); + childrenSection.classList.add('mt-4'); + childrenSection.innerHTML = `