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 built myself a custom component (com_medialibrary) and have it installed and running on Joomla 5. One odd thing I noticed is that multiple menu items in the main sidebar menu get highlighted as "active" despite me only viewing the Items view of my custom Media Library component.
See some screenshots below to help show what I am trying to explain...
Unsure why both menu items are marked as "active".
Now here only the single menu item is properly marked as "active".
Expected result
After navigating to the custom Media Library component Items view menu item, only com_medialibrary Items view menu item (/administrator/index.php?option=com_medialibrary) gets the mm-active class applied to it.
Actual result
After navigating to the custom Media Library component Items view menu item, both com_media default view menu item (administrator/index.php?option=com_media&path=local-images:/) and com_medialibrary Items view menu item (/administrator/index.php?option=com_medialibrary) get the mm-active class applied to both of them.
System information (as much as possible)
Joomla 5.2.3
Default Atum template and default navigation menu
Additional comments
I believe the "issue" to be related to the foreach if condition that begins on/around line 56 of media/mod_menu/js/admin-menu.js but I am not sure how exactly the admin menu works...
As if the Javascript code is incorrectly matching the URL strings.
This behavior only happens when I navigate to Components > Media Library > Items view (/administrator/index.php?option=com_medialibrary)
If I navigate to Content > Media (administrator/index.php?option=com_media&path=local-images:/) then only the Content > Media menu item gets the mm-active class applied, not the menu item in my custom component.
Any thoughts?
The text was updated successfully, but these errors were encountered:
Hello all.
I built myself a custom component (
com_medialibrary
) and have it installed and running on Joomla 5. One odd thing I noticed is that multiple menu items in the main sidebar menu get highlighted as "active" despite me only viewing the Items view of my custom Media Library component.See some screenshots below to help show what I am trying to explain...
Unsure why both menu items are marked as "active".
Now here only the single menu item is properly marked as "active".
Expected result
After navigating to the custom Media Library component Items view menu item, only com_medialibrary Items view menu item (
/administrator/index.php?option=com_medialibrary
) gets themm-active
class applied to it.Actual result
After navigating to the custom Media Library component Items view menu item, both com_media default view menu item (
administrator/index.php?option=com_media&path=local-images:/
) and com_medialibrary Items view menu item (/administrator/index.php?option=com_medialibrary
) get themm-active
class applied to both of them.System information (as much as possible)
Additional comments
I believe the "issue" to be related to the foreach if condition that begins on/around line 56 of
media/mod_menu/js/admin-menu.js
but I am not sure how exactly the admin menu works...if (!link.href.match(/index\.php$/) && currentUrl.indexOf(link.href) === 0 || link.href.match(/index\.php$/) && currentUrl.match(/index\.php$/)) {
As if the Javascript code is incorrectly matching the URL strings.
This behavior only happens when I navigate to Components > Media Library > Items view (
/administrator/index.php?option=com_medialibrary
)If I navigate to Content > Media (
administrator/index.php?option=com_media&path=local-images:/
) then only the Content > Media menu item gets themm-active
class applied, not the menu item in my custom component.Any thoughts?
The text was updated successfully, but these errors were encountered: