Fix issue when switching branch when BLOB is shown

Fix blob-switching for AJAX-Requests

Reorder
This commit is contained in:
Patrick Helm
2013-04-23 00:59:09 +02:00
parent 5ac5f586f8
commit 93dd06fc2d
4 changed files with 5 additions and 1 deletions
+2
View File
@@ -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
+1 -1
View File
@@ -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
+1
View File
@@ -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() {
+1
View File
@@ -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() {