Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open parent entry of dropdown menus on first click #703

Merged
merged 1 commit into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 */