diff options
author | Robb Kidd <robb@thekidds.org> | 2012-06-19 02:36:25 +0400 |
---|---|---|
committer | Robb Kidd <robb@thekidds.org> | 2012-06-19 02:36:25 +0400 |
commit | 5b1ede628065ecfdf95552322328b5bb7613753a (patch) | |
tree | 1c9921beea5dfbe811d366d0047bdbf90a515517 /app | |
parent | 7484bcfff7fc8e132d94701b3af47f521ce117c5 (diff) |
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.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/merge_requests.js | 13 | ||||
-rw-r--r-- | app/views/merge_requests/_commits.html.haml | 2 |
2 files changed, 8 insertions, 7 deletions
diff --git a/app/assets/javascripts/merge_requests.js b/app/assets/javascripts/merge_requests.js index c075cb4c0a3..9a18f335559 100644 --- a/app/assets/javascripts/merge_requests.js +++ b/app/assets/javascripts/merge_requests.js @@ -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"); + }); +}); diff --git a/app/views/merge_requests/_commits.html.haml b/app/views/merge_requests/_commits.html.haml index 49c8e8cd77d..ad3cba2b822 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 - = 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 |