Commit 5dfe3d73 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #3668 from Deradon/fix-blob-switching

Fix issue when switching branch when BLOB is shown
parents 5ac5f586 93dd06fc
......@@ -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
......
%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
......@@ -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() {
......
......@@ -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() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment