##// END OF EJS Templates
Keep the "new object" drop down open when the + sign was clicked (#15880)....
Jean-Philippe Lang -
r15122:3da6062d7eb5
parent child
Show More
@@ -226,7 +226,8 Redmine::MenuManager.map :admin_menu do |menu|
226 226 end
227 227
228 228 Redmine::MenuManager.map :project_menu do |menu|
229 menu.push :new_object, nil, :caption => ' + '
229 menu.push :new_object, nil, :caption => ' + ',
230 :html => { :id => 'new-object', :onclick => 'toggleNewObjectDropdown(); return false;' }
230 231 menu.push :new_issue_category, {:controller => 'issue_categories', :action => 'new'}, :param => :project_id, :caption => :label_issue_category_new,
231 232 :parent => :new_object
232 233 menu.push :new_version, {:controller => 'versions', :action => 'new'}, :param => :project_id, :caption => :label_version_new,
@@ -725,6 +725,15 function toggleDisabledInit() {
725 725 $('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange);
726 726 }
727 727
728 function toggleNewObjectDropdown() {
729 var dropdown = $('#new-object + ul.menu-children');
730 if(dropdown.hasClass('visible')){
731 dropdown.removeClass('visible');
732 }else{
733 dropdown.addClass('visible');
734 }
735 }
736
728 737 (function ( $ ) {
729 738
730 739 // detect if native date input is supported
@@ -51,7 +51,7 pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;}
51 51 padding: 4px 10px 4px 10px;
52 52 }
53 53 #main-menu li a:hover {background:#759FCF; color:#fff;}
54 #main-menu li:hover ul.menu-children {display: block;}
54 #main-menu li:hover ul.menu-children, #main-menu li ul.menu-children.visible {display: block;}
55 55 #main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;}
56 56 #main-menu li a.new-object { background-color:#759FCF; }
57 57
General Comments 0
You need to be logged in to leave comments. Login now