diff --git a/CHANGELOG.md b/CHANGELOG.md index 41efb35..a7f0cb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,10 @@ Types of changes Security in case of vulnerabilities. ) +## [2.3.3](https://github.com/contao-themes-net/nature-theme-bundle/tree/2.3.3) – 2024-09-24 + +- [Fixed] Close mobile navigation after click if onepage navigation is enabled + ## [2.3.2](https://github.com/contao-themes-net/nature-theme-bundle/tree/2.3.2) – 2024-04-22 - [Fixed] Fix form captcha (delete custom `form_captcha template`) diff --git a/config/services.yml b/config/services.yml index 9553a48..221e919 100644 --- a/config/services.yml +++ b/config/services.yml @@ -1,13 +1,4 @@ services: - _instanceof: - Contao\CoreBundle\Framework\FrameworkAwareInterface: - calls: - - ["setFramework", ["@contao.framework"]] - - Symfony\Component\DependencyInjection\ContainerAwareInterface: - calls: - - ["setContainer", ["@service_container"]] - # Migration ContaoThemesNet\NatureThemeBundle\Migration\: resource: "../src/Migration/*" diff --git a/contao/templates/jquery/j_onepage_navigation_nature.html5 b/contao/templates/jquery/j_onepage_navigation_nature.html5 index ede72ed..fab579d 100644 --- a/contao/templates/jquery/j_onepage_navigation_nature.html5 +++ b/contao/templates/jquery/j_onepage_navigation_nature.html5 @@ -75,5 +75,17 @@ navigationSection(); }); + const navToggler = document.querySelector('.mod_onepage_navigation .navbar-burger'); + const navMobile = document.querySelector('.onepage_navigation__list'); + + navMobile.querySelectorAll('a[data-onepage-link]').forEach ((link) => { + link.addEventListener('click', (event) => { + navToggler.classList.remove('is-active'); + + setTimeout(function() { + navMobile.classList.remove('is-active'); + }, 200); + }); + }); }); diff --git a/src/Module/NatureThemeSetup.php b/src/Module/NatureThemeSetup.php index 79100ea..ebc2200 100644 --- a/src/Module/NatureThemeSetup.php +++ b/src/Module/NatureThemeSetup.php @@ -22,7 +22,7 @@ class NatureThemeSetup extends BackendModule { - public const VERSION = '2.3.2'; + public const VERSION = '2.3.3'; protected $strTemplate = 'be_naturetheme_setup';