OSDN Git Service

Get rid of deprecated link_to_function
authorrandx <dmitriy.zaporozhets@gmail.com>
Wed, 20 Jun 2012 18:29:55 +0000 (21:29 +0300)
committerrandx <dmitriy.zaporozhets@gmail.com>
Wed, 20 Jun 2012 18:29:55 +0000 (21:29 +0300)
app/assets/javascripts/application.js
app/assets/javascripts/merge_requests.js
app/assets/stylesheets/common.scss
app/views/commits/_text_file.html.haml
app/views/merge_requests/_commits.html.haml

index 0af0b11..61d6539 100644 (file)
@@ -53,6 +53,14 @@ $(document).ready(function(){
         e.preventDefault();
     }
   });
+
+  /**
+   * Commit show suppressed diff
+   * 
+   */
+  $(".supp_diff_link").bind("click", function() {
+    showDiff(this);
+  })
 });
 
 function focusSearch() {
index c075cb4..8df090c 100644 (file)
@@ -34,6 +34,10 @@ var MergeRequest = {
         $(".merge-request-diffs").show();
         e.preventDefault();
       });
+
+      $(".mr_show_all_commits").bind("click", function() { 
+        MergeRequest.showAllCommits();
+      })
     },
 
   showState:
index 82d43d4..0888b6d 100644 (file)
@@ -602,3 +602,7 @@ li.note {
   min-height:42px;
 }
 
+.supp_diff_link,
+.mr_show_all_commits { 
+  cursor:pointer;
+}
index e5173b0..fa3d83c 100644 (file)
@@ -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|
index 441a7f3..3c0c44e 100644 (file)
@@ -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