Rename tree.js to tree.js.coffee
This commit is contained in:
parent
c626ec3746
commit
b5328879f5
|
@ -1,30 +0,0 @@
|
||||||
/**
|
|
||||||
* Tree slider for code browse
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
var Tree = {
|
|
||||||
init:
|
|
||||||
function() {
|
|
||||||
$('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live("click", function() {
|
|
||||||
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
|
|
||||||
})
|
|
||||||
|
|
||||||
$('.project-refs-form').live({
|
|
||||||
"ajax:beforeSend": function() {
|
|
||||||
$("#tree-content-holder").hide("slide", { direction: "left" }, 150);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
$("#tree-slider .tree-item").live('click', function(e){
|
|
||||||
if(e.target.nodeName != "A") {
|
|
||||||
link = $(this).find(".tree-item-file-name a");
|
|
||||||
link.trigger("click");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live({
|
|
||||||
"ajax:beforeSend": function() { $('.tree_progress').addClass("loading"); },
|
|
||||||
"ajax:complete": function() { $('.tree_progress').removeClass("loading"); }
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
20
app/assets/javascripts/tree.js.coffee
Normal file
20
app/assets/javascripts/tree.js.coffee
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
# Code browser tree slider
|
||||||
|
|
||||||
|
$ ->
|
||||||
|
if $('#tree-slider').length > 0
|
||||||
|
# Show the "Loading commit data" for only the first element
|
||||||
|
$('span.log_loading:first').removeClass('hide')
|
||||||
|
|
||||||
|
$('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live "click", ->
|
||||||
|
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
|
||||||
|
|
||||||
|
$('.project-refs-form').live
|
||||||
|
"ajax:beforeSend": -> $("#tree-content-holder").hide("slide", { direction: "left" }, 150)
|
||||||
|
|
||||||
|
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
|
||||||
|
$("#tree-slider .tree-item").live 'click', (e) ->
|
||||||
|
$('.tree-item-file-name a', this).trigger('click') if (e.target.nodeName != "A")
|
||||||
|
|
||||||
|
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live
|
||||||
|
"ajax:beforeSend": -> $('.tree_progress').addClass("loading")
|
||||||
|
"ajax:complete": -> $('.tree_progress').removeClass("loading")
|
Loading…
Reference in a new issue