diff --git a/app/assets/javascripts/merge_requests.js b/app/assets/javascripts/merge_requests.js new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/app/assets/javascripts/merge_requests.js.coffee b/app/assets/javascripts/merge_requests.js.coffee deleted file mode 100644 index 761567942fc20b22ba68ce6b5f46652cf63c48c0..0000000000000000000000000000000000000000 --- a/app/assets/javascripts/merge_requests.js.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/ diff --git a/app/assets/javascripts/projects.js b/app/assets/javascripts/projects.js index 4ffbd140d6e6bd3d01df16be9a55b579190a2324..7d21f061703b22427739feaf5094f9f86168c592 100644 --- a/app/assets/javascripts/projects.js +++ b/app/assets/javascripts/projects.js @@ -1,17 +1,4 @@ $(document).ready(function(){ - $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() { - history.pushState({ path: this.path }, '', this.href) - }) - - $("#tree-slider tr.tree-item").live('click', function(e){ - if(e.target.nodeName != "A") { - e.stopPropagation(); - link = $(this).find("td.tree-item-file-name a") - link.click(); - return false; - } - }); - $("#projects-list .project").live('click', function(e){ if(e.target.nodeName != "A" && e.target.nodeName != "INPUT") { location.href = $(this).attr("url"); diff --git a/app/assets/javascripts/tree.js b/app/assets/javascripts/tree.js new file mode 100644 index 0000000000000000000000000000000000000000..6edd7e49c5ad9e9238689e64ea266e77bcbfb949 --- /dev/null +++ b/app/assets/javascripts/tree.js @@ -0,0 +1,21 @@ +/** + * Tree slider for code browse + * + */ +var Tree = { + init: + function() { + $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() { + history.pushState({ path: this.path }, '', this.href) + }) + + $("#tree-slider tr.tree-item").live('click', function(e){ + if(e.target.nodeName != "A") { + e.stopPropagation(); + link = $(this).find("td.tree-item-file-name a"); + link.click(); + return false; + } + }); + } +} diff --git a/app/views/refs/tree.html.haml b/app/views/refs/tree.html.haml index e59bbf05ee3e697b878daa260cb39f15239e4bfa..46eeb6f5c295dc33cf5ca01ceef269838485526a 100644 --- a/app/views/refs/tree.html.haml +++ b/app/views/refs/tree.html.haml @@ -1 +1,6 @@ #tree-holder= render :partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree} + +:javascript + $(function() { + Tree.init(); + });