diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/CoreHome/javascripts/menu.js | 11 | ||||
-rw-r--r-- | plugins/CoreHome/templates/_menu.twig | 10 |
2 files changed, 12 insertions, 9 deletions
diff --git a/plugins/CoreHome/javascripts/menu.js b/plugins/CoreHome/javascripts/menu.js index b229a0fab5..128a22188c 100644 --- a/plugins/CoreHome/javascripts/menu.js +++ b/plugins/CoreHome/javascripts/menu.js @@ -38,9 +38,12 @@ menu.prototype = }, 2000); }, - onItemClick: function (item) { - $('.Menu--dashboard').trigger('piwikSwitchPage', item); - broadcast.propagateAjax( $(item).attr('href').substr(1) ); + onItemClick: function (e) { + if (e.which !== 1) { + return; + } + $('.Menu--dashboard').trigger('piwikSwitchPage', this); + broadcast.propagateAjax( $(this).attr('href').substr(1) ); return false; }, @@ -81,6 +84,8 @@ menu.prototype = } }); + this.menuNode.find('a.item').click(this.onItemClick); + menu.prototype.adaptSubMenuHeight(); }, diff --git a/plugins/CoreHome/templates/_menu.twig b/plugins/CoreHome/templates/_menu.twig index f46264879b..63c1d75aca 100644 --- a/plugins/CoreHome/templates/_menu.twig +++ b/plugins/CoreHome/templates/_menu.twig @@ -1,8 +1,7 @@ {% macro submenuItem(name, url) %} {% if name|slice(0,1) != '_' %} <li> - <a href='#{{ url|urlRewriteWithParameters|slice(1) }}' - onclick='return piwikMenu.onItemClick(this);'> + <a class="item" href='#{{ url|urlRewriteWithParameters|slice(1) }}'> {{ name|translate }} </a> </li> @@ -15,8 +14,7 @@ {% for item in group.getItems %} <a class="item" href='#{{ item.url|urlRewriteWithParameters|slice(1) }}' - {% if item.tooltip %}title="{{ item.tooltip|e('html_attr') }}"{% endif %} - onclick='return piwikMenu.onItemClick(this);'> + {% if item.tooltip %}title="{{ item.tooltip|e('html_attr') }}"{% endif %}> {{ item.name|translate }} </a> {% endfor %} @@ -41,8 +39,8 @@ <ul class="Menu-tabList"> {% for level1,level2 in menu %} <li id="{% if level2._url is defined %}{{ _self.getId(level2._url) }}{% endif %}"> - <a {% if level2._url is defined %}href="#{{ _self.getFirstUrl(level2._url) }}"{% endif %} - onclick="return piwikMenu.onItemClick(this);">{{ level1|translate }} + <a class="item" {% if level2._url is defined %}href="#{{ _self.getFirstUrl(level2._url) }}"{% endif %}> + {{ level1|translate }} <span class="hidden"> {{ 'CoreHome_Menu'|translate }} </span> |