Commit 65c35394 authored by Valeriy Sizov's avatar Valeriy Sizov

Merge pull request #951 from robbkidd/remove_link_to_function

Replace calls to deprecated link_to_function with doc-ready functions.
parents 4ac0160a ef1598b4
...@@ -75,11 +75,6 @@ function slugify(text) { ...@@ -75,11 +75,6 @@ function slugify(text) {
return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase(); return text.replace(/[^-a-zA-Z0-9]+/g, '_').toLowerCase();
} }
function showDiff(link) {
$(link).next('table').show();
$(link).remove();
}
(function($){ (function($){
var _chosen = $.fn.chosen; var _chosen = $.fn.chosen;
$.fn.extend({ $.fn.extend({
......
...@@ -57,3 +57,10 @@ var CommitsList = { ...@@ -57,3 +57,10 @@ var CommitsList = {
}); });
} }
} }
$(function () {
$('a.supp_diff_link').live('click', function() {
$(link).next('table').show();
$(link).remove();
});
});
...@@ -58,15 +58,16 @@ var MergeRequest = { ...@@ -58,15 +58,16 @@ var MergeRequest = {
dataType: "script"}); dataType: "script"});
}, },
showAllCommits:
function() {
$(".first_mr_commits").remove();
$(".all_mr_commits").removeClass("hide");
},
already_cannot_be_merged: already_cannot_be_merged:
function(){ function(){
$(".automerge_widget").hide(); $(".automerge_widget").hide();
$(".automerge_widget.already_cannot_be_merged").show(); $(".automerge_widget.already_cannot_be_merged").show();
} }
} }
$(function () {
$('.first_mr_commits a.show_all').live('click', function() {
$(".first_mr_commits").remove();
$(".all_mr_commits").removeClass("hide");
});
});
- 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|
......
- unless @commits.empty? - if @commits.present?
.ui-box .ui-box
%h5 Commits (#{@commits.count}) %h5 Commits (#{@commits.count})
.merge-request-commits .merge-request-commits
...@@ -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.show_all 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