XF 2.3 Avoid a specific menu to close

Newsman

Member
Hey there!

Let's say I have a menu somewhere. And as you know, if you click on another element that isn't the menu, the menu will be closed.

Is there a way to avoid this? I found the data-menu-closer attribute but don't know if that is related to my problem..

(just to elaborate a bit: I want to click on a different element without a specific open menu closing)

Cheers!

Edit: thinking more about it.. it would be cool to mark certain elements as "non-menu-closing" elements when they are being clicked on..
 
Last edited:
I've found the solution!

When necessary, I used XF.MenuWatcher.preventDocClick() to disable the closure of menus - and then use XF.MenuWatcher.allowDocClick() to enable the function again. This allows you to click on elements that are not part of the menu and placed outside of them (y)
 
Top Bottom