gitlabhq/app/assets/javascripts/tree.js

31 lines
930 B
JavaScript
Raw Normal View History

2011-12-12 19:08:04 +01:00
/**
* Tree slider for code browse
*
*/
var Tree = {
init:
function() {
2012-01-29 20:30:03 +01:00
$('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live("click", function() {
2011-12-20 07:59:14 +01:00
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
2011-12-12 19:08:04 +01:00
})
2012-01-29 20:30:03 +01:00
$('.project-refs-form').live({
"ajax:beforeSend": function() {
$("#tree-content-holder").hide("slide", { direction: "left" }, 150);
}
})
2012-01-29 11:45:51 +01:00
$("#tree-slider .tree-item").live('click', function(e){
2011-12-12 19:08:04 +01:00
if(e.target.nodeName != "A") {
2012-01-29 11:45:51 +01:00
link = $(this).find(".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
2012-01-29 20:30:03 +01:00
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live({
2012-01-11 08:35:21 +01:00
"ajax:beforeSend": function() { $('.tree_progress').addClass("loading"); },
"ajax:complete": function() { $('.tree_progress').removeClass("loading"); }
2011-12-20 07:59:14 +01:00
});
2011-12-12 19:08:04 +01:00
}
}