Commit bbb926f3c49ea32320ec2e000e03a9d45b94197b

Authored by Dmitriy Zaporozhets
2 parents 6507c108 d5b41831

Merge pull request #952 from gitlabhq/remove_link_to_function

Get rid of deprecated link_to_function
app/assets/javascripts/application.js
... ... @@ -53,6 +53,14 @@ $(document).ready(function(){
53 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 66 function focusSearch() {
... ...
app/assets/javascripts/merge_requests.js
... ... @@ -34,6 +34,10 @@ var MergeRequest = {
34 34 $(".merge-request-diffs").show();
35 35 e.preventDefault();
36 36 });
  37 +
  38 + $(".mr_show_all_commits").bind("click", function() {
  39 + MergeRequest.showAllCommits();
  40 + })
37 41 },
38 42  
39 43 showState:
... ...
app/assets/stylesheets/common.scss
... ... @@ -602,3 +602,7 @@ li.note {
602 602 min-height:42px;
603 603 }
604 604  
  605 +.supp_diff_link,
  606 +.mr_show_all_commits {
  607 + cursor:pointer;
  608 +}
... ...
app/views/commits/_text_file.html.haml
1 1 - too_big = max_lines = diff.diff.lines.count > 1000
2 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 5 %table{:class => "#{'hide' if too_big}"}
6 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 9 %li.bottom
10 10 8 of #{@commits.count} commits displayed.
11 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 13 %ul.all_mr_commits.hide.unstyled
14 14 - @commits.each do |commit|
15 15 = render "commits/commit", :commit => commit
... ...