diff options
Diffstat (limited to 'app/assets/javascripts/tree.js')
-rw-r--r-- | app/assets/javascripts/tree.js | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/app/assets/javascripts/tree.js b/app/assets/javascripts/tree.js new file mode 100644 index 00000000000..6edd7e49c5a --- /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; + } + }); + } +} |