BigW Consortium Gitlab

Commit 5b1ede62 by Robb Kidd

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. https://github.com/rails/rails/commit/9dc57fe9c Still absent is a graceful degrade for no-JS.
parent 7484bcff
......@@ -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");
});
});
......@@ -9,7 +9,7 @@
%li.bottom
8 of #{@commits.count} commits displayed.
%strong
= link_to_function "Click here to show all", "MergeRequest.showAllCommits()"
%a.show_all Click here to show all
%ul.all_mr_commits.hide.unstyled
- @commits.each do |commit|
= render "commits/commit", :commit => commit
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment