# HG changeset patch # User Mads Kiilerich # Date 1438770581 -7200 # Node ID 5f0f341c5a4429b76cbff54e48b865ac8eaa7d89 # Parent e87baa8f1c5bd2488aefc23b95c0db3a04bc8431 comments: previous/next links should only be to first comment for a given line Before, each comment had its own link to previous/next comment - also if it was right before/after in the same thread. Comments right before/after in the same thread are however easy to navigate to with scrolling or arrow keys or pageup/down. Navigating to the next thread could take a lot of clicks to cycle through every single comment ever made. Instead, just show the link at the top of each thread and let the links navigate between threads. This also make long threads use less vertical space. One downside of this change is that it for long threads takes a bit more work to get from the last comment in a thread to the next thread. diff -r e87baa8f1c5b -r 5f0f341c5a44 kallithea/public/js/base.js --- a/kallithea/public/js/base.js Wed Aug 05 12:29:41 2015 +0200 +++ b/kallithea/public/js/base.js Wed Aug 05 12:29:41 2015 +0200 @@ -627,7 +627,7 @@ $anchorcomment.before("Comment to {0} line {1} which is outside the diff context:".format(f_path || '?', line_no || '?')); } }); - linkInlineComments($('.firstlink'), $('.comment')); + linkInlineComments($('.firstlink'), $('.comment:first-child')); } // comment bubble was clicked - insert new tr and show form @@ -700,7 +700,7 @@ var success = function(json_data) { $comment_div.append(json_data['rendered_text']); comment_div_state($comment_div, f_path, line_no, false); - linkInlineComments($('.firstlink'), $('.comment')); + linkInlineComments($('.firstlink'), $('.comment:first-child')); }; var postData = { 'text': text,