From 9f8c87c9f9130847312d36452d79b24770ef4997 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Mon, 7 Oct 2024 15:32:43 +0200 Subject: [PATCH] Fix dropdown menu in mobile view (#735) --- assets/js/frontend.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/frontend.js b/assets/js/frontend.js index 9490a33..3b91787 100644 --- a/assets/js/frontend.js +++ b/assets/js/frontend.js @@ -202,7 +202,12 @@ function addRssReadMore() { // make parent item of dropdowm menu clickable which is not intended by Bootstrap jQuery( '.dropdown .dropdown-toggle' ).on( 'click', function () { - if ( jQuery( '.dropdown:hover' ).length !== 0 ) { + const dropdownOpen = jQuery( this ).hasClass( 'show' ); // dropdown shown + const mobileOpen = jQuery( '#mainmenu-container' ).hasClass( 'show' ); // mobile nav open + if ( + ( dropdownOpen === false && mobileOpen === true ) || + ( dropdownOpen === true && mobileOpen === false ) + ) { window.location = jQuery( this ).attr( 'href' ); }