inveniosoftware / flask-menu

Flask-Menu is a Flask extension that adds support for generating menus.
https://flask-menu.readthedocs.io
Other
53 stars 45 forks source link

Active menu item doesn't take into account url parameters #55

Closed Stumblinbear closed 8 years ago

Stumblinbear commented 8 years ago

I use /jack/view/ as the route. Currently, there are 3 menu items (they're created at runtime so there could be less or more) which direct to the following:

/jack/view/1ab3qpkluhy8iuwczyzw59cge7fa6oc3 /jack/view/t1655vudl2rhm5j6iojupr47j5o0fezh /jack/view/6hh83e0had26kd0tbdvqg5s9kjz4btcl

Though, when one is selected, all the menu items are set to active.

jirikuncar commented 8 years ago

@Stumblinbear can you please provide a minimal application or test case that can show the wanted behavior? Thanks

Stumblinbear commented 8 years ago

https://gist.github.com/Stumblinbear/969b15a4e49a06a54a01542c53d1729b

The "*" shows the currently active items. Note that in "current.py" all three subitems under "Third" are active, while the intended behavior is for only one of them to be active. I realize it may be slightly odd in how I generate them at runtime, though that's the only way I could think to do so

jirikuncar commented 8 years ago

@Stumblinbear thanks! I'm not sure when I will have time to have a look at it. Anyway PRs are welcome if you have a patch.

jirikuncar commented 8 years ago

@Stumblinbear please see my comment at your Gist.

Stumblinbear commented 8 years ago

Oh hey, thanks. I wasn't aware that existed. It's all fixed, now~ ^^