diff --git a/kallithea/public/js/base.js b/kallithea/public/js/base.js --- a/kallithea/public/js/base.js +++ b/kallithea/public/js/base.js @@ -847,10 +847,9 @@ var renderInlineComments = function(file /** * Double link comments */ -var linkInlineComments = function(firstlinks, comments){ - var $comments = $(comments); +var linkInlineComments = function($firstlinks, $comments){ if ($comments.length > 0) { - $(firstlinks).html('First comment'.format($comments.attr('id'))); + $firstlinks.html('First comment'.format($comments.attr('id'))); } if ($comments.length <= 1) { return; @@ -859,12 +858,12 @@ var linkInlineComments = function(firstl $comments.each(function(i, e){ var prev = ''; if (i > 0){ - var prev_anchor = YUD.getAttribute(comments.item(i-1),'id'); + var prev_anchor = $($comments.get(i-1)).attr('id'); prev = 'Previous comment'.format(prev_anchor); } var next = ''; - if (i+1 < comments.length){ - var next_anchor = YUD.getAttribute(comments.item(i+1),'id'); + if (i+1 < $comments.length){ + var next_anchor = $($comments.get(i+1)).attr('id'); next = 'Next comment'.format(next_anchor); } var $div = $(('