summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Helm <deradon87@gmail.com>2013-04-23 00:28:30 +0200
committerPatrick Helm <deradon87@gmail.com>2013-04-23 00:59:09 +0200
commit93dd06fc2d81869a95dc24df004027ba489b3ec0 (patch)
tree5628bcd33c8b6f444fd1535eb9ca46c04fc583b3
parent5ac5f586f8685368be9adb999297642feca1736e (diff)
downloadgitlab-ce-93dd06fc2d81869a95dc24df004027ba489b3ec0.tar.gz
Fix issue when switching branch when BLOB is shown
Fix blob-switching for AJAX-Requests Reorder
-rw-r--r--app/controllers/refs_controller.rb2
-rw-r--r--app/views/blob/show.html.haml2
-rw-r--r--app/views/blob/show.js.haml1
-rw-r--r--app/views/tree/show.js.haml1
4 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb
index e116bc358c9..188feb73ec1 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 d1ca0e05e83..d96595bc7f0 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 804107f42fa..0b76661cb7d 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 a01d49179b9..1e08688fb09 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() {