You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm loading the menu dynamically in a plugin system. I define 1 function for the fun property of each menu item. There doesn't seem to be a way for me to tell when inside this function what menu item was clicked.
The text was updated successfully, but these errors were encountered:
The tag itself (and the text) is available in the 2nd argument to your function or the event. From that you can extract the text and determine the menu item:
arguments[1].target
value: <li title="This is an example" class=iw-mSelected">Some Menu Item
or: event.target.innerText
If it's a submenu you can determine the parent item and figure out the context, should you have duplicate menu items.
Using JQuery: $(event.target).parent().parent()[0]
result: <li title="New..." class="iw-has-submenu iw-mTrigger iw-mSelected>
I'm loading the menu dynamically in a plugin system. I define 1 function for the fun property of each menu item. There doesn't seem to be a way for me to tell when inside this function what menu item was clicked.
The text was updated successfully, but these errors were encountered: