From: Jean-Philippe Lang Date: Sat, 13 May 2017 09:23:44 +0000 (+0000) Subject: Preserve jump param when searching for projects. X-Git-Tag: 3.4.0~127 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=8dad27236b5b8b50287d6264c2a8cc4c503eda39;p=redmine.git Preserve jump param when searching for projects. git-svn-id: http://svn.redmine.org/redmine/trunk@16551 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 94382a37b..f1241d8b7 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -356,11 +356,12 @@ module ApplicationHelper end def render_projects_for_jump_box(projects, selected=nil) + jump = params[:jump].presence || current_menu_item s = ''.html_safe project_tree(projects) do |project, level| padding = level * 16 text = content_tag('span', project.name, :style => "padding-left:#{padding}px;") - s << link_to(text, project_path(project, :jump => current_menu_item), :title => project.name, :class => (project == selected ? 'selected' : nil)) + s << link_to(text, project_path(project, :jump => jump), :title => project.name, :class => (project == selected ? 'selected' : nil)) end s end @@ -369,8 +370,10 @@ module ApplicationHelper def render_project_jump_box projects = projects_for_jump_box(User.current) text = @project.try(:name) || l(:label_jump_to_a_project) + url = autocomplete_projects_path(:format => 'js', :jump => current_menu_item) + trigger = content_tag('span', text, :class => 'drdn-trigger') - q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => autocomplete_projects_path(:format => 'js')}, :autocomplete => 'off') + q = text_field_tag('q', '', :id => 'projects-quick-search', :class => 'autocomplete', :data => {:automcomplete_url => url}, :autocomplete => 'off') all = link_to(l(:label_project_all), projects_path(:jump => current_menu_item), :class => (@project.nil? && controller.class.main_menu ? 'selected' : nil)) content = content_tag('div', content_tag('div', q, :class => 'quick-search') +