]> source.dussan.org Git - redmine.git/commitdiff
Preserve jump param when searching for projects.
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 May 2017 09:23:44 +0000 (09:23 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sat, 13 May 2017 09:23:44 +0000 (09:23 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@16551 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb

index 94382a37b0f2584c88d830ec0f77488f24516029..f1241d8b75a2f3116f01e10ad746d8425f1eda88 100644 (file)
@@ -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') +