From 1e77d5f89803ef60935dce789b95fbe22b3a13a4 Mon Sep 17 00:00:00 2001 From: Alexander Bigga Date: Mon, 12 Aug 2024 16:38:56 +0200 Subject: [PATCH] Open parent entry of dropdown menus on first click --- assets/js/frontend.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/assets/js/frontend.js b/assets/js/frontend.js index e181087..78daa78 100644 --- a/assets/js/frontend.js +++ b/assets/js/frontend.js @@ -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 */