Handle MR "show all commits" link with a doc-ready event handler.

Replaces link_to_function use which was deprecated in Rails v3.2.4.
9dc57fe9c

Still absent is a graceful degrade for no-JS.
This commit is contained in:
Robb Kidd 2012-06-18 18:36:25 -04:00
parent 7484bcfff7
commit 5b1ede6280
2 changed files with 8 additions and 7 deletions

View file

@ -58,15 +58,16 @@ var MergeRequest = {
dataType: "script"});
},
showAllCommits:
function() {
$(".first_mr_commits").remove();
$(".all_mr_commits").removeClass("hide");
},
already_cannot_be_merged:
function(){
$(".automerge_widget").hide();
$(".automerge_widget.already_cannot_be_merged").show();
}
}
$(function () {
$('.first_mr_commits a.show_all').live('click', function() {
$(".first_mr_commits").remove();
$(".all_mr_commits").removeClass("hide");
});
});