Port ApplicationHelper patches
This commit is contained in:
parent
484ed29fa2
commit
c23f73e9fe
|
@ -934,6 +934,32 @@ module ApplicationHelper
|
|||
end
|
||||
end
|
||||
|
||||
# Expands the current menu item using JavaScript based on the params
|
||||
def expand_current_menu
|
||||
current_menu_class =
|
||||
case
|
||||
when params[:controller] == "timelog"
|
||||
"reports"
|
||||
when params[:controller] == 'projects' && params[:action] == 'changelog'
|
||||
"reports"
|
||||
when params[:controller] == 'issues' && ['calendar','gantt'].include?(params[:action])
|
||||
"reports"
|
||||
when params[:controller] == 'projects' && params[:action] == 'roadmap'
|
||||
'roadmap'
|
||||
when params[:controller] == 'versions' && params[:action] == 'show'
|
||||
'roadmap'
|
||||
when params[:controller] == 'projects' && params[:action] == 'settings'
|
||||
'settings'
|
||||
when params[:controller] == 'contracts' || params[:controller] == 'deliverables'
|
||||
'contracts'
|
||||
else
|
||||
params[:controller]
|
||||
end
|
||||
|
||||
|
||||
javascript_tag("jQuery.menu_expand({ menuItem: '.#{current_menu_class}' });")
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def wiki_helper
|
||||
|
|
Loading…
Reference in New Issue