Skip to content

Commit

Permalink
Merge pull request #95 from contao-themes-net/bugfix/onepage-navigati…
Browse files Browse the repository at this point in the history
…on-c5

Close mobile navigation after click if onepage navigation is enabled (contao 5)
  • Loading branch information
MDevster authored Oct 23, 2024
2 parents f5cfada + 982d672 commit 0f9bcd4
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
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.
)

## [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`)
Expand Down
9 changes: 0 additions & 9 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -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/*"
Expand Down
12 changes: 12 additions & 0 deletions contao/templates/jquery/j_onepage_navigation_nature.html5
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});
</script>
2 changes: 1 addition & 1 deletion src/Module/NatureThemeSetup.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down

0 comments on commit 0f9bcd4

Please sign in to comment.