Skip to content

Commit

Permalink
[ADD] Active class for custom admin panel menu item.
Browse files Browse the repository at this point in the history
  • Loading branch information
Seiger committed Jul 4, 2023
1 parent bbfc1b8 commit 1a1e0e9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions manager/media/style/default/js/modx.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,12 @@
e.preventDefault();
}
}
if (!a.classList.contains('dropdown-toggle') && !a.closest('ul').classList.contains('dropdown-menu')) {
mm.querySelectorAll('.nav li.active').forEach(function (el) {
el.classList.remove('active');
});
a.closest('.nav > li').classList.add('active');
}
});
mm.addEventListener('click', function (e) {
let li = e.target.closest('.nav li');
Expand Down

0 comments on commit 1a1e0e9

Please sign in to comment.