changeset 5361:5f0f341c5a44

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.
author Mads Kiilerich <madski@unity3d.com>
date Wed, 05 Aug 2015 12:29:41 +0200
parents e87baa8f1c5b
children 24d01c64c5f3
files kallithea/public/js/base.js
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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,