Commit 339dfa32b810b8f15c26c85e692a18a0f47b9fca
1 parent
79a02df9
Exists in
master
and in
4 other branches
Fix ref_switcher path
Showing
3 changed files
with
3 additions
and
3 deletions
Show diff stats
app/views/shared/_ref_switcher.html.haml
1 | 1 | = form_tag switch_project_refs_path(@project), method: :get, class: "project-refs-form" do |
2 | 2 | = select_tag "ref", grouped_options_refs, class: "project-refs-select chosen" |
3 | 3 | = hidden_field_tag :destination, destination |
4 | - - if respond_to?(:path) | |
4 | + - if defined?(path) | |
5 | 5 | = hidden_field_tag :path, path | ... | ... |
app/views/tree/_head.html.haml
1 | 1 | %ul.nav.nav-tabs |
2 | 2 | %li |
3 | - = render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: params[:path]} | |
3 | + = render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: @path} | |
4 | 4 | %li{class: "#{'active' if (controller.controller_name == "tree") }"} |
5 | 5 | = link_to project_tree_path(@project, @ref) do |
6 | 6 | Source | ... | ... |
app/views/tree/show.js.haml
... | ... | @@ -2,7 +2,7 @@ |
2 | 2 | // Load Files list |
3 | 3 | $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {repo: @repo, commit: @commit, tree: @tree}))}"); |
4 | 4 | $("#tree-content-holder").show("slide", { direction: "right" }, 150); |
5 | - $('.project-refs-form #path').val("#{params[:path]}"); | |
5 | + $('.project-refs-form #path').val("#{@path}"); | |
6 | 6 | |
7 | 7 | // Load last commit log for each file in tree |
8 | 8 | $('#tree-slider').waitForImages(function() { | ... | ... |