diff --git a/app/static/css/default.css b/app/static/css/default.css
index 6adc62e..d4b71fa 100644
--- a/app/static/css/default.css
+++ b/app/static/css/default.css
@@ -113,4 +113,27 @@ h3.footer-title{
.dropdown-menu.collapse.show {
display: block;
-}
\ No newline at end of file
+}
+
+/* Standardmäßig sind die Submenüs ausgeblendet */
+.dropdown-submenu .dropdown-menu {
+ display: none;
+ opacity: 0;
+ transition: opacity 0.3s ease-in-out;
+ position: absolute;
+ left: 100%;
+ top: 0;
+}
+
+/* Beim Hover auf das Submenü-Element wird das Menü angezeigt */
+.dropdown-submenu:hover > .dropdown-menu {
+ display: block;
+ opacity: 1;
+ z-index: 1050;
+}
+
+/* Um sicherzustellen, dass es nicht sofort verschwindet */
+.dropdown-submenu:hover > .dropdown-menu:hover {
+ display: block;
+ opacity: 1;
+}
diff --git a/app/static/js/close-submenus.js b/app/static/js/close-submenus.js
deleted file mode 100644
index 1f5e2c6..0000000
--- a/app/static/js/close-submenus.js
+++ /dev/null
@@ -1,21 +0,0 @@
-document.addEventListener('DOMContentLoaded', () => {
- const dropdownSubmenus = document.querySelectorAll('.dropdown-submenu > .dropdown-item');
-
- dropdownSubmenus.forEach((submenu) => {
- submenu.addEventListener('click', (event) => {
- event.preventDefault();
- const targetMenu = document.querySelector(submenu.getAttribute('data-bs-target'));
- const allSubmenus = document.querySelectorAll('.dropdown-menu.collapse');
-
- // Schließe alle anderen Submenüs
- allSubmenus.forEach((menu) => {
- if (menu !== targetMenu) {
- menu.classList.remove('show');
- }
- });
-
- // Toggle des aktuellen Submenüs
- targetMenu.classList.toggle('show');
- });
- });
-});
diff --git a/app/static/js/submenus.js b/app/static/js/submenus.js
new file mode 100644
index 0000000..4d611de
--- /dev/null
+++ b/app/static/js/submenus.js
@@ -0,0 +1,28 @@
+document.addEventListener('DOMContentLoaded', () => {
+ const dropdownSubmenus = document.querySelectorAll('.dropdown-submenu');
+
+ dropdownSubmenus.forEach(submenu => {
+ let timeout;
+
+ // Zeige das Submenü beim Hover
+ submenu.addEventListener('mouseenter', () => {
+ clearTimeout(timeout);
+ const menu = submenu.querySelector('.dropdown-menu');
+ if (menu) {
+ menu.style.display = 'block';
+ menu.style.opacity = '1';
+ }
+ });
+
+ // Verstecke das Submenü nach 0.5 Sekunden
+ submenu.addEventListener('mouseleave', () => {
+ const menu = submenu.querySelector('.dropdown-menu');
+ if (menu) {
+ timeout = setTimeout(() => {
+ menu.style.display = 'none';
+ menu.style.opacity = '0';
+ }, 500); // 0.5 Sekunden Verzögerung
+ }
+ });
+ });
+});
diff --git a/app/templates/moduls/base.html.j2 b/app/templates/moduls/base.html.j2
index 3a2cd75..6123906 100644
--- a/app/templates/moduls/base.html.j2
+++ b/app/templates/moduls/base.html.j2
@@ -39,7 +39,7 @@
{% include "moduls/modal.html.j2" %}
-
+