Add id to work package main menu item wrapper…

… to make the query container selectable
pull/1524/head
Till Breuer 11 years ago
parent d8d23cdd64
commit 72caa89259
  1. 19
      app/assets/javascripts/specific/main_menu.js.erb
  2. 1
      lib/redmine.rb

@ -76,7 +76,24 @@ jQuery(document).ready(function($) {
return false;
});
$('#main-menu li > a').not('ul ul a').wrap('<div class="main-item-wrapper"/>');
// 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 = $('<div class="main-item-wrapper"/>')
// 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

@ -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'

Loading…
Cancel
Save