BigW Consortium Gitlab

Commit 93dd06fc by Patrick Helm

Fix issue when switching branch when BLOB is shown

Fix blob-switching for AJAX-Requests Reorder
parent 5ac5f586
......@@ -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