Commit 3d4f524dcb7bc8c3fb10daaf49d1dd8504967706
1 parent
6bdcaccb
Exists in
master
and in
4 other branches
play with tree view
Showing
4 changed files
with
18 additions
and
5 deletions
Show diff stats
2.55 KB
app/assets/javascripts/tree.js
... | ... | @@ -5,17 +5,23 @@ |
5 | 5 | var Tree = { |
6 | 6 | init: |
7 | 7 | function() { |
8 | + (new Image).src = "/assets/ajax-loader-tree.gif"; | |
9 | + | |
8 | 10 | $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() { |
9 | 11 | history.pushState({ path: this.path }, '', this.href) |
12 | + $("#tree-content-holder").hide("slide", { direction: "left" }, 150) | |
10 | 13 | }) |
11 | 14 | |
12 | 15 | $("#tree-slider tr.tree-item").live('click', function(e){ |
13 | 16 | if(e.target.nodeName != "A") { |
14 | - e.stopPropagation(); | |
15 | 17 | link = $(this).find("td.tree-item-file-name a"); |
16 | - link.click(); | |
17 | - return false; | |
18 | + link.trigger("click"); | |
18 | 19 | } |
19 | 20 | }); |
21 | + | |
22 | + $('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live({ | |
23 | + "ajax:beforeSend": function() { $('h2.icon').addClass("loading") }, | |
24 | + "ajax:complete": function() { $('h2.icon').removeClass("loading")} | |
25 | + }); | |
20 | 26 | } |
21 | 27 | } | ... | ... |
app/assets/stylesheets/projects.css.scss
app/views/refs/tree.js.haml
1 | 1 | :plain |
2 | - $("#tree-content-holder").hide("slide", { direction: "left" }, 150, function(){ | |
2 | + //$("#tree-content-holder").hide("slide", { direction: "left" }, 150, function(){ | |
3 | 3 | $("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}"); |
4 | 4 | $("#tree-content-holder").show("slide", { direction: "right" }, 150); |
5 | - }); | |
5 | + //}); | ... | ... |