diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index e116bc358c..188feb73ec 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -13,6 +13,8 @@ class RefsController < ProjectResourceController format.html do new_path = if params[:destination] == "tree" project_tree_path(@project, (@ref + "/" + params[:path])) + elsif params[:destination] == "blob" + project_blob_path(@project, (@ref + "/" + params[:path])) elsif params[:destination] == "graph" project_graph_path(@project, @ref) else diff --git a/app/views/blob/show.html.haml b/app/views/blob/show.html.haml index d1ca0e05e8..d96595bc7f 100644 --- a/app/views/blob/show.html.haml +++ b/app/views/blob/show.html.haml @@ -1,4 +1,4 @@ %div.tree-ref-holder - = render 'shared/ref_switcher', destination: 'tree', path: @path + = render 'shared/ref_switcher', destination: 'blob', path: @path %div#tree-holder.tree-holder = render 'blob', blob: @blob diff --git a/app/views/blob/show.js.haml b/app/views/blob/show.js.haml index 804107f42f..0b76661cb7 100644 --- a/app/views/blob/show.js.haml +++ b/app/views/blob/show.js.haml @@ -3,6 +3,7 @@ $("#tree-holder").html("#{escape_javascript(render(partial: "blob", locals: {blob: @blob}))}"); $("#tree-content-holder").show("slide", { direction: "right" }, 400); $('.project-refs-form #path').val("#{@path}"); + $(".project-refs-form #destination").val("blob"); // Load last commit log for each file in tree $('#tree-slider').waitForImages(function() { diff --git a/app/views/tree/show.js.haml b/app/views/tree/show.js.haml index a01d49179b..1e08688fb0 100644 --- a/app/views/tree/show.js.haml +++ b/app/views/tree/show.js.haml @@ -3,6 +3,7 @@ $("#tree-holder").html("#{escape_javascript(render(partial: "tree", locals: {tree: @tree}))}"); $("#tree-content-holder").show("slide", { direction: "right" }, 400); $('.project-refs-form #path').val("#{@path}"); + $(".project-refs-form #destination").val("tree"); // Load last commit log for each file in tree $('#tree-slider').waitForImages(function() {