Skip to content

Commit

Permalink
Merge pull request #94 from contao-themes-net/bugfix/onepage-navigation
Browse files Browse the repository at this point in the history
Close mobile navigation after click if onepage navigation is enabled (contao 4)
  • Loading branch information
MDevster authored Oct 23, 2024
2 parents c4d0d9b + 20248c1 commit 7e5aa2a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Types of changes
Security in case of vulnerabilities.
)

## [1.12.2](https://github.com/contao-themes-net/nature-theme-bundle/tree/1.12.2) – 2024-09-24

- [Fixed] Close mobile navigation after click if onepage navigation is enabled

## [1.12.1](https://github.com/contao-themes-net/nature-theme-bundle/tree/1.12.1) – 2024-04-22

- [Fixed] Fix form captcha (delete custom `form_captcha template`)
Expand Down
2 changes: 1 addition & 1 deletion src/Module/NatureThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

class NatureThemeSetup extends BackendModule
{
public const VERSION = '1.12.1';
public const VERSION = '1.12.2';

protected $strTemplate = 'be_naturetheme_setup';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,4 +76,17 @@
});

});

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);
});
});
</script>

0 comments on commit 7e5aa2a

Please sign in to comment.