gitlabhq/app/assets/javascripts/tree.js

28 lines
849 B
JavaScript
Raw Normal View History

2011-12-12 19:08:04 +01:00
/**
* Tree slider for code browse
*
*/
var Tree = {
init:
function() {
2011-12-20 07:59:14 +01:00
(new Image).src = "/assets/ajax-loader-tree.gif";
2011-12-12 19:08:04 +01:00
$('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() {
history.pushState({ path: this.path }, '', this.href)
2011-12-20 07:59:14 +01:00
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
2011-12-12 19:08:04 +01:00
})
$("#tree-slider tr.tree-item").live('click', function(e){
if(e.target.nodeName != "A") {
link = $(this).find("td.tree-item-file-name a");
2011-12-20 07:59:14 +01:00
link.trigger("click");
2011-12-12 19:08:04 +01:00
}
});
2011-12-20 07:59:14 +01:00
$('#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")}
});
2011-12-12 19:08:04 +01:00
}
}