diff --git a/app/assets/javascripts/specific/main_menu.js.erb b/app/assets/javascripts/specific/main_menu.js.erb index 36707142e3..ef34119ffa 100644 --- a/app/assets/javascripts/specific/main_menu.js.erb +++ b/app/assets/javascripts/specific/main_menu.js.erb @@ -76,7 +76,24 @@ jQuery(document).ready(function($) { return false; }); - $('#main-menu li > a').not('ul ul a').wrap('
'); + // wrap main items + var mainItems = $('#main-menu li > a').not('ul ul a'); + + function getMainItemWrapper(index) { + var item = mainItems[index]; + var elementId = item.id; + + var wrapperElement = $('') + + // inherit element id + if(elementId) { + wrapperElement.attr('id', elementId + '-wrapper') + } + + return wrapperElement; + } + + mainItems.wrap(getMainItemWrapper) $('#main-menu li:has(ul) .main-item-wrapper > a').not('ul ul a') // 1. unbind the current click functions diff --git a/lib/redmine.rb b/lib/redmine.rb index fbf2fb0200..d6a1934ec0 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -299,6 +299,7 @@ Redmine::MenuManager.map :project_menu do |menu| param: :project_id, caption: :label_work_package_plural, html: { + id: 'main-menu-work-packages', class: "icon2 icon-copy", "data-ui-route" => '', query_menu_item: 'query_menu_item'