Project

General

Profile

Feature #15880 » 0004-keep-the-new-object-drop-down-open-when-the-sign-was.patch

Jan from Planio www.plan.io, 2016-06-06 14:26

View differences:

lib/redmine.rb
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,
public/javascripts/application.js
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
public/stylesheets/application.css
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

  
(5-5/11)