New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rewrite the way menu.js detects the active menu item (don't set elements, look for links w/ the right URL) #8669
Conversation
Just had a small look. It seems not to work when directly opening a specific goal. There is no selection happening in that case. Guess that happens as the goals are in a special "submenu" |
I tested this specifically since that was the bug I was trying to fix in another plugin. Can you check again? It's possible it doesn't work anymore though... |
Sure. I'll recheck that... |
Ah ok. Works! Guess I forgot to kill the assets |
I've now tried that several more times. |
Guess the reason is, that the dropdowns are not finished rendering. When activateMenu() is called the links found in the menu don't contain the goals. Maybe we need to increase the timeout or maybe also trigger menu activation when the dropdowns are finished |
Thanks for looking into it! I'll see if I can fix it somehow. |
Can't reproduce this on firefox or chrome. What browser are you using? |
Chrome on Windows 7
But I can test on Firefox or IE later
|
…and query the IDs when detecting the active menu item, instead find the link w/ the appropriate parameters get the parent li element. Also, do not activate the menu item until all angular menu group dropdowns are rendered.
Can reproduce on IE11 |
…owns are rendered.
06f629a
to
1eb0243
Compare
Only way I could fix this issue was w/ two CC @mattab |
Feedback:
The menu was already rewritten in Piwik 3.0.0 branch so this "hack" is not a problem IMHO |
Unrelated bug, happens for me on demo2. |
…e broadcast to get the actual value in the hash/url.
@diosmosis there are couple UI tests failing: http://builds-artifacts.piwik.org/piwik/piwik/8624_module_active_detect/15246/ - could you investigate, and once fixed, +1 to merge |
Fixes #8624, rewrite the way menu.js detects the active menu item (don't set elements, look for links w/ the right URL)
This change changes the way menu.js detects the active menu item.
The old way of detecting menu items includes:
<li>
element, finding it's associated menu linkid
of the<li>
element to something like{{ module}}_{{ action }}
<li>
element w/ the proper ID.This creates a problem for plugins that add menu items to existing menu tabs (eg, adding a page to
Goals
). When the page is active, Piwik will look for the menu item for the plugin (eg,MyPlugin
) and won't find it or will activate the wrong tab group.This change fixes this bug by changing the way active items are detected to:
<li>
parents that represent the menu tab / menu item.Fixes #8624