diff options
author | diosmosis <benaka@piwik.pro> | 2015-09-09 01:10:49 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2015-09-09 01:10:49 +0300 |
commit | 1eb024393831938d99c96bc02057f28482157423 (patch) | |
tree | 0ab1bd473d1619d890670d34d63f7741e76fea6d /plugins/CoreHome/javascripts/broadcast.js | |
parent | 8df498e4b0622ec8cbe97cde5a13a13f37854ca2 (diff) |
Use two empty $timeouts to activate menu after the angular menu dropdowns are rendered.
Diffstat (limited to 'plugins/CoreHome/javascripts/broadcast.js')
-rw-r--r-- | plugins/CoreHome/javascripts/broadcast.js | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/CoreHome/javascripts/broadcast.js b/plugins/CoreHome/javascripts/broadcast.js index 425936ff8b..de34b45a90 100644 --- a/plugins/CoreHome/javascripts/broadcast.js +++ b/plugins/CoreHome/javascripts/broadcast.js @@ -410,18 +410,21 @@ var broadcast = { loadAjaxContent: function (urlAjax) { if (typeof piwikMenu !== 'undefined') { // 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. + // page load, the dropdown will not be completely rendered at this point. using 2 $timeouts (to push + // the menu activation logic to the end of the event queue twice), seems to work. 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); + $timeout(function () { + piwikMenu.activateMenu( + broadcast.getParamValue('module', urlAjax), + broadcast.getParamValue('action', urlAjax), + { + idGoal: broadcast.getParamValue('idGoal', urlAjax), + idDashboard: broadcast.getParamValue('idDashboard', urlAjax) + } + ); + }); + }); }); } |