Commit 6507c1085e02d9e59020c38ceff3308374dd1df0

Authored by Zevs
1 parent a9c7de88

Revert "Handle Commit "show suppressed diff" link with a doc-ready event handler."

This reverts commit ef1598b4afa94b21db7f38755182a701d03ae44a.
app/assets/javascripts/application.js
... ... @@ -75,6 +75,11 @@ function slugify(text) {
75 75 return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
76 76 }
77 77  
  78 +function showDiff(link) {
  79 + $(link).next('table').show();
  80 + $(link).remove();
  81 +}
  82 +
78 83 (function($){
79 84 var _chosen = $.fn.chosen;
80 85 $.fn.extend({
... ...
app/assets/javascripts/commits.js
... ... @@ -57,10 +57,3 @@ var CommitsList = {
57 57 });
58 58 }
59 59 }
60   -
61   -$(function () {
62   - $('a.supp_diff_link').live('click', function() {
63   - $(link).next('table').show();
64   - $(link).remove();
65   - });
66   -});
... ...
app/views/commits/_text_file.html.haml
1 1 - too_big = max_lines = diff.diff.lines.count > 1000
2 2 - if too_big
3   - %a.supp_diff_link Diff suppressed. Click to show
  3 + = link_to_function "Diff suppressed. Click to show", "showDiff(this)", :class => "supp_diff_link"
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|
... ...