Commit bbb926f3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge pull request #952 from gitlabhq/remove_link_to_function

Get rid of deprecated link_to_function
parents 6507c108 d5b41831
...@@ -53,6 +53,14 @@ $(document).ready(function(){ ...@@ -53,6 +53,14 @@ $(document).ready(function(){
e.preventDefault(); e.preventDefault();
} }
}); });
/**
* Commit show suppressed diff
*
*/
$(".supp_diff_link").bind("click", function() {
showDiff(this);
});
}); });
function focusSearch() { function focusSearch() {
......
...@@ -34,6 +34,10 @@ var MergeRequest = { ...@@ -34,6 +34,10 @@ var MergeRequest = {
$(".merge-request-diffs").show(); $(".merge-request-diffs").show();
e.preventDefault(); e.preventDefault();
}); });
$(".mr_show_all_commits").bind("click", function() {
MergeRequest.showAllCommits();
})
}, },
showState: showState:
......
...@@ -602,3 +602,7 @@ li.note { ...@@ -602,3 +602,7 @@ li.note {
min-height:42px; min-height:42px;
} }
.supp_diff_link,
.mr_show_all_commits {
cursor:pointer;
}
- too_big = max_lines = diff.diff.lines.count > 1000 - too_big = max_lines = diff.diff.lines.count > 1000
- if too_big - 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}"} %table{:class => "#{'hide' if too_big}"}
- each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old| - each_diff_line(diff.diff.lines.to_a, index) do |line, type, line_code, line_new, line_old|
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
%li.bottom %li.bottom
8 of #{@commits.count} commits displayed. 8 of #{@commits.count} commits displayed.
%strong %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 %ul.all_mr_commits.hide.unstyled
- @commits.each do |commit| - @commits.each do |commit|
= render "commits/commit", :commit => commit = render "commits/commit", :commit => commit
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment