Problem/Motivation

A common request from clients is to not visit a link of opened dropdown menus but to close the link on click.

Proposed resolution

Add a new theme option 'Navbar open dropdown click behavior' with two options 'visit' and 'close'. Use this option in JS code to turn off current visit link.

Comments

pivica created an issue. See original summary.

pivica’s picture

Status: Active » Needs review
StatusFileSize
new4.51 KB

Here is a patch.

pivica’s picture

StatusFileSize
new0 bytes
new2.1 KB

Small refactoring.

pivica’s picture

Uploaded empty patch last time, here is a correct one.

pivica’s picture

Finally here is a same patch from 3 build on top of other active patches - handy for projects that are using other stuff that are still not committed.

pivica’s picture

I've noticed couple of problems:

1. We introduced a bug with #3117130: Second level dropdown menu issues - that check for menu level 0 when second level is horizontal was not properly checking is responsive menu active or not.

2. Edge case when second level is dropdown and second level link has third level links rendered - visiting of links is not possible.

Issue number 1. should be fixed, issue number 2. is mostly fixed - there is additional edge case which is easy to overcome with configuration changes.

NOTE: no idea about patch in comment 4, it seems it is not needed, patch in 5 is a valid one for both current dev and custom projects that are using other patches.

pivica’s picture

Reminder - this needs documentation update!

pivica’s picture

StatusFileSize
new7.56 KB
new4.17 KB

Proposing to rename new option from 'Navbar open dropdown click behavior' to 'Navbar opened submenu behavior'. Config key would be renamed form navbar_open_dropdown_click_behavior to navbar_opened_submenu_behavior.

Name changing is done for future support for both dropdown and horizontal submenus.

This is done in preparation for much bigger navbar issue which goal will be to bring various improvements and consolidation between all possible navbar options settings - stay tune for this, issue is still discussed internally, ddo issue(s) will be created after all discussion is done and we can start with implementation.

  • pivica committed f3c4bb6 on 8.x-1.x
    Issue #3274026 by pivica: Add navbar open dropdown click behavior
    
pivica’s picture

Status: Needs review » Fixed

Committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.