Skip to content

Commit

Permalink
Fix dropdown menu in mobile view (verdigado#735)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig authored Oct 7, 2024
1 parent 06f261c commit 9f8c87c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion assets/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
}

Expand Down

0 comments on commit 9f8c87c

Please sign in to comment.