diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 0af0b11a931..8b8c4291f5d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -53,6 +53,14 @@ $(document).ready(function(){ e.preventDefault(); } }); + + /** + * Commit show suppressed diff + * + */ + $(".supp_diff_link").bind("click", function() { + showDiff(this); + }); }); function focusSearch() { diff --git a/app/assets/javascripts/merge_requests.js b/app/assets/javascripts/merge_requests.js index c075cb4c0a3..8df090cfa37 100644 --- a/app/assets/javascripts/merge_requests.js +++ b/app/assets/javascripts/merge_requests.js @@ -34,6 +34,10 @@ var MergeRequest = { $(".merge-request-diffs").show(); e.preventDefault(); }); + + $(".mr_show_all_commits").bind("click", function() { + MergeRequest.showAllCommits(); + }) }, showState: diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 82d43d4c83e..0888b6db1f5 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -602,3 +602,7 @@ li.note { min-height:42px; } +.supp_diff_link, +.mr_show_all_commits { + cursor:pointer; +} diff --git a/app/views/commits/_text_file.html.haml b/app/views/commits/_text_file.html.haml index e5173b00ed7..fa3d83ca85d 100644 --- a/app/views/commits/_text_file.html.haml +++ b/app/views/commits/_text_file.html.haml @@ -1,6 +1,6 @@ - too_big = max_lines = diff.diff.lines.count > 1000 - if too_big - = link_to_function "Diff suppressed. Click to show", "showDiff(this)", :class => "supp_diff_link" + %a.supp_diff_link Diff suppressed. Click to show %table{:class => "#{'hide' if too_big}"} - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| diff --git a/app/views/merge_requests/_commits.html.haml b/app/views/merge_requests/_commits.html.haml index 441a7f32ef4..3c0c44e069a 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.mr_show_all_commits Click here to show all %ul.all_mr_commits.hide.unstyled - @commits.each do |commit| = render "commits/commit", :commit => commit