Commit 3d4f524d authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

play with tree view

parent 6bdcaccb
No related merge requests found
app/assets/images/ajax-loader-tree.gif

2.55 KB

......@@ -5,17 +5,23 @@
var Tree = {
init:
function() {
(new Image).src = "/assets/ajax-loader-tree.gif";
$('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() {
history.pushState({ path: this.path }, '', this.href)
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
})
$("#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;
link.trigger("click");
}
});
$('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live({
"ajax:beforeSend": function() { $('h2.icon').addClass("loading") },
"ajax:complete": function() { $('h2.icon').removeClass("loading")}
});
}
}
......@@ -647,3 +647,10 @@ h4.middle-panel {
border-radius:3px;
float:left;
}
body.project-page h2.icon.loading {
span {
background-position: 0px 0px;
background: url("ajax-loader-tree.gif") no-repeat;
}
}
:plain
$("#tree-content-holder").hide("slide", { direction: "left" }, 150, function(){
//$("#tree-content-holder").hide("slide", { direction: "left" }, 150, function(){
$("#tree-holder").html("#{escape_javascript(render(:partial => "tree", :locals => {:repo => @repo, :commit => @commit, :tree => @tree}))}");
$("#tree-content-holder").show("slide", { direction: "right" }, 150);
});
//});
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment