Commit bbb926f3c49ea32320ec2e000e03a9d45b94197b
Exists in
master
and in
4 other branches
Merge pull request #952 from gitlabhq/remove_link_to_function
Get rid of deprecated link_to_function
Showing
5 changed files
with
18 additions
and
2 deletions
Show diff stats
app/assets/javascripts/application.js
| @@ -53,6 +53,14 @@ $(document).ready(function(){ | @@ -53,6 +53,14 @@ $(document).ready(function(){ | ||
| 53 | e.preventDefault(); | 53 | e.preventDefault(); |
| 54 | } | 54 | } |
| 55 | }); | 55 | }); |
| 56 | + | ||
| 57 | + /** | ||
| 58 | + * Commit show suppressed diff | ||
| 59 | + * | ||
| 60 | + */ | ||
| 61 | + $(".supp_diff_link").bind("click", function() { | ||
| 62 | + showDiff(this); | ||
| 63 | + }); | ||
| 56 | }); | 64 | }); |
| 57 | 65 | ||
| 58 | function focusSearch() { | 66 | function focusSearch() { |
app/assets/javascripts/merge_requests.js
| @@ -34,6 +34,10 @@ var MergeRequest = { | @@ -34,6 +34,10 @@ var MergeRequest = { | ||
| 34 | $(".merge-request-diffs").show(); | 34 | $(".merge-request-diffs").show(); |
| 35 | e.preventDefault(); | 35 | e.preventDefault(); |
| 36 | }); | 36 | }); |
| 37 | + | ||
| 38 | + $(".mr_show_all_commits").bind("click", function() { | ||
| 39 | + MergeRequest.showAllCommits(); | ||
| 40 | + }) | ||
| 37 | }, | 41 | }, |
| 38 | 42 | ||
| 39 | showState: | 43 | showState: |
app/assets/stylesheets/common.scss
app/views/commits/_text_file.html.haml
| 1 | - too_big = max_lines = diff.diff.lines.count > 1000 | 1 | - too_big = max_lines = diff.diff.lines.count > 1000 |
| 2 | - if too_big | 2 | - if too_big |
| 3 | - = link_to_function "Diff suppressed. Click to show", "showDiff(this)", :class => "supp_diff_link" | 3 | + %a.supp_diff_link Diff suppressed. Click to show |
| 4 | 4 | ||
| 5 | %table{:class => "#{'hide' if too_big}"} | 5 | %table{:class => "#{'hide' if too_big}"} |
| 6 | - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| | 6 | - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| |
app/views/merge_requests/_commits.html.haml
| @@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
| 9 | %li.bottom | 9 | %li.bottom |
| 10 | 8 of #{@commits.count} commits displayed. | 10 | 8 of #{@commits.count} commits displayed. |
| 11 | %strong | 11 | %strong |
| 12 | - = link_to_function "Click here to show all", "MergeRequest.showAllCommits()" | 12 | + %a.mr_show_all_commits Click here to show all |
| 13 | %ul.all_mr_commits.hide.unstyled | 13 | %ul.all_mr_commits.hide.unstyled |
| 14 | - @commits.each do |commit| | 14 | - @commits.each do |commit| |
| 15 | = render "commits/commit", :commit => commit | 15 | = render "commits/commit", :commit => commit |