visdesignlab / visdesignlab.github.io

https://vdl.sci.utah.edu/
BSD 3-Clause "New" or "Revised" License
6 stars 21 forks source link

fix active menu/nav item highlight #61

Closed mckennapsean closed 6 years ago

mckennapsean commented 6 years ago

The code had some broken logic on detecting the currently "active" page. I fixed the functionality. It also works for nested pages based on the top-level nav commands. For example, a personal page (like Alex's) starts with team/' in the URL scheme, so "Team" is highlighted. Works similarly for publication pages.

This does mean hover effects of the menu show two things. Considering that most devices use a mouse or trackpad for hover effects, the user is more likely to track their cursor and know which item they are looking to click. Could be wrong, so feel free to write an issue on that. Not sure how else to fix that without some javascript to change the "active" class to something temporarily, on a menu item hover.