Changeset - 5f0f341c5a44
[Not reviewed]
default
0 1 0
Mads Kiilerich - 10 years ago 2015-08-05 12:29:41
madski@unity3d.com
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.
1 file changed with 2 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -624,13 +624,13 @@ function move_comments($anchorcomments) 
 
            $comment_div.append($anchorcomment.children());
 
            _comment_div_append_add($comment_div, f_path, line_no);
 
        } else {
 
           $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
 
function show_comment_form($bubble) {
 
    var children = $bubble.closest('tr.line').children('[id]');
 
    var line_td_id = children[children.length - 1].id;
 
@@ -697,13 +697,13 @@ function _comment_div_append_form($comme
 

	
 
        $form.find('.submitting-overlay').show();
 

	
 
        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,
 
            'f_path': f_path,
 
            'line': line_no
 
        };
0 comments (0 inline, 0 general)