diff options
-rw-r--r-- | lib/redmine.rb | 3 | ||||
-rw-r--r-- | public/javascripts/application.js | 9 | ||||
-rw-r--r-- | public/stylesheets/application.css | 2 |
3 files changed, 12 insertions, 2 deletions
diff --git a/lib/redmine.rb b/lib/redmine.rb index bed89ef68..d75cfd336 100644 --- a/lib/redmine.rb +++ b/lib/redmine.rb @@ -226,7 +226,8 @@ Redmine::MenuManager.map :admin_menu do |menu| end Redmine::MenuManager.map :project_menu do |menu| - menu.push :new_object, nil, :caption => ' + ' + menu.push :new_object, nil, :caption => ' + ', + :html => { :id => 'new-object', :onclick => 'toggleNewObjectDropdown(); return false;' } menu.push :new_issue_category, {:controller => 'issue_categories', :action => 'new'}, :param => :project_id, :caption => :label_issue_category_new, :parent => :new_object menu.push :new_version, {:controller => 'versions', :action => 'new'}, :param => :project_id, :caption => :label_version_new, diff --git a/public/javascripts/application.js b/public/javascripts/application.js index 347611bb2..eedeae08b 100644 --- a/public/javascripts/application.js +++ b/public/javascripts/application.js @@ -725,6 +725,15 @@ function toggleDisabledInit() { $('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange); } +function toggleNewObjectDropdown() { + var dropdown = $('#new-object + ul.menu-children'); + if(dropdown.hasClass('visible')){ + dropdown.removeClass('visible'); + }else{ + dropdown.addClass('visible'); + } +} + (function ( $ ) { // detect if native date input is supported diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index c6d6e4c05..3ab2eccf2 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -51,7 +51,7 @@ pre, code {font-family: Consolas, Menlo, "Liberation Mono", Courier, monospace;} padding: 4px 10px 4px 10px; } #main-menu li a:hover {background:#759FCF; color:#fff;} -#main-menu li:hover ul.menu-children {display: block;} +#main-menu li:hover ul.menu-children, #main-menu li ul.menu-children.visible {display: block;} #main-menu li a.selected, #main-menu li a.selected:hover {background:#fff; color:#555;} #main-menu li a.new-object { background-color:#759FCF; } |