diff options
author | diosmosis <benaka@piwik.pro> | 2015-08-31 02:08:11 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-09-08 23:17:48 +0300 |
commit | 8df498e4b0622ec8cbe97cde5a13a13f37854ca2 (patch) | |
tree | de7ffba301ac4a2c6890522f1859850c1e1eda82 /plugins/CoreHome/javascripts/broadcast.js | |
parent | 6e287a2b0edadf867628ffda5194f35627a47c71 (diff) |
Refs #8624, do not set the ID of link elements in the reporting menu 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.
Diffstat (limited to 'plugins/CoreHome/javascripts/broadcast.js')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 51b2a8a64d..425936ff8b 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -409,11 +409,20 @@ var broadcast = { */ loadAjaxContent: function (urlAjax) { if (typeof piwikMenu !== 'undefined') { - piwikMenu.activateMenu( - broadcast.getParamValue('module', urlAjax), - broadcast.getParamValue('action', urlAjax), - broadcast.getParamValue('idGoal', urlAjax) || broadcast.getParamValue('idDashboard', urlAjax) - ); + // we have to use a $timeout since menu groups are displayed using an angular directive, and on initial + // page load, the dropdown will not be completely rendered at this point. + angular.element(document).injector().invoke(function ($timeout) { + $timeout(function () { + piwikMenu.activateMenu( + broadcast.getParamValue('module', urlAjax), + broadcast.getParamValue('action', urlAjax), + { + idGoal: broadcast.getParamValue('idGoal', urlAjax), + idDashboard: broadcast.getParamValue('idDashboard', urlAjax) + } + ); + }, 1); + }); } if(broadcast.getParamValue('module', urlAjax) == 'API') { |