Skip to content

Commit

Permalink
Open parent entry of dropdown menus on first click (#703)
Browse files Browse the repository at this point in the history
  • Loading branch information
albig committed Aug 23, 2024
1 parent 48077b8 commit 6f89447
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions assets/js/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,11 +200,10 @@ function addRssReadMore() {

// make parent item of dropdowm menu clickable which is not intended by Bootstrap
jQuery( '.dropdown .dropdown-toggle' ).on( 'click', function () {
const dropdownOpen = jQuery( this ).hasClass( 'show' );
// open parent menu only on second click/touch which will close the dropdown menu
if ( ! dropdownOpen ) {
if ( jQuery( '.dropdown:hover' ).length !== 0 ) {
window.location = jQuery( this ).attr( 'href' );
}

return false;
} );
/* eslint-enable no-undef */

0 comments on commit 6f89447

Please sign in to comment.