OSDN Git Service

Revert "Handle Commit "show suppressed diff" link with a doc-ready event handler."
authorZevs <vsv2711@gmail.com>
Wed, 20 Jun 2012 18:01:27 +0000 (21:01 +0300)
committerZevs <vsv2711@gmail.com>
Wed, 20 Jun 2012 18:01:27 +0000 (21:01 +0300)
This reverts commit ef1598b4afa94b21db7f38755182a701d03ae44a.

app/assets/javascripts/application.js
app/assets/javascripts/commits.js
app/views/commits/_text_file.html.haml

index bc91c97..0af0b11 100644 (file)
@@ -75,6 +75,11 @@ function slugify(text) {
   return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
 }
 
+function showDiff(link) {
+  $(link).next('table').show();
+  $(link).remove();
+}
+
 (function($){
     var _chosen = $.fn.chosen;
     $.fn.extend({
index 5afac8c..b31fe48 100644 (file)
@@ -57,10 +57,3 @@ var CommitsList = {
       });
     }
 }
-
-$(function () {
-  $('a.supp_diff_link').live('click', function() {
-    $(link).next('table').show();
-    $(link).remove();
-  });
-});
index fa3d83c..e5173b0 100644 (file)
@@ -1,6 +1,6 @@
 - too_big = max_lines = diff.diff.lines.count > 1000
 - if too_big
-  %a.supp_diff_link Diff suppressed. Click to show
+  = link_to_function "Diff suppressed. Click to show", "showDiff(this)", :class => "supp_diff_link"
 
 %table{:class => "#{'hide' if too_big}"}
   - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|