diff --git a/app/assets/javascripts/merge_requests.js b/app/assets/javascripts/merge_requests.js index 9a18f335559b0db01c6411d50f89c7dd300f7dd4..c075cb4c0a3f0bf6aa8c9c57e60358077755bbc3 100644 --- a/app/assets/javascripts/merge_requests.js +++ b/app/assets/javascripts/merge_requests.js @@ -58,16 +58,15 @@ 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"); - }); -}); diff --git a/app/views/merge_requests/_commits.html.haml b/app/views/merge_requests/_commits.html.haml index bad328b67928a568a825022afa6586f2a161a14b..441a7f32ef4cc55250c0a8a1acd1cd64be3e9c49 100644 --- a/app/views/merge_requests/_commits.html.haml +++ b/app/views/merge_requests/_commits.html.haml @@ -9,7 +9,7 @@ %li.bottom 8 of #{@commits.count} commits displayed. %strong - %a.show_all Click here to show all + = link_to_function "Click here to show all", "MergeRequest.showAllCommits()" %ul.all_mr_commits.hide.unstyled - @commits.each do |commit| = render "commits/commit", :commit => commit