diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 0af0b11a931080e6b4ba33c5e809b01a5fe8b58b..8b8c4291f5d5a2630bb34dfd7c39444b4d59d398 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 c075cb4c0a3f0bf6aa8c9c57e60358077755bbc3..8df090cfa3779644312f89e2c0cfadecd717ddca 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 82d43d4c83ed5a7397221bb9fe5c8cdbef9509ce..0888b6db1f58e647da5e46c2d5e8be159554a6a7 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 e5173b00ed734af7227c1d17a757700a16f9497b..fa3d83ca85d53b16804513e9eb447e46f7f722a8 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 441a7f32ef4cc55250c0a8a1acd1cd64be3e9c49..3c0c44e069aaf79b3ad25830603b6dc5b74d183a 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