Changeset - 765fe407eda4
[Not reviewed]
default
0 3 0
Mads Kiilerich - 11 years ago 2015-05-17 21:54:55
madski@unity3d.com
comments: refactor the DOM handling for previous/next comment links

Make it more clear which div the links are put into and set the whole content
of that div instead of appending. This prepares for repeatedly re-linking the
comments when new comments or comment forms are inserted in the text.
3 files changed with 6 insertions and 6 deletions:
0 comments (0 inline, 0 general)
kallithea/public/css/style.css
Show inline comments
 
@@ -5065,8 +5065,8 @@ div.comment:target>.comment-wrapp {
 
    margin: 5px;
 
}
 

	
 
div.prev-next-comment div.prev-comment,
 
div.prev-next-comment div.next-comment {
 
div.comment-prev-next-links div.prev-comment,
 
div.comment-prev-next-links div.next-comment {
 
    display: inline-block;
 
    min-width: 150px;
 
    margin: 3px 6px;
kallithea/public/js/base.js
Show inline comments
 
@@ -866,10 +866,9 @@ var linkInlineComments = function($first
 
                var next_anchor = $($comments.get(i+1)).attr('id');
 
                next = '<a href="#{0}">Next comment</a>'.format(next_anchor);
 
            }
 
            var $div = $(('<div class="prev-next-comment">'+
 
                          '<div class="prev-comment">{0}</div>'+
 
                          '<div class="next-comment">{1}</div>').format(prev, next));
 
            $div.prependTo(this);
 
            $(this).find('.comment-prev-next-links').html(
 
                '<div class="prev-comment">{0}</div>'.format(prev) +
 
                '<div class="next-comment">{0}</div>'.format(next));
 
        });
 
}
 

	
kallithea/templates/changeset/changeset_file_comment.html
Show inline comments
 
@@ -5,6 +5,7 @@
 
##
 
<%def name="comment_block(co)">
 
  <div class="comment" id="comment-${co.comment_id}" line="${co.line_no}">
 
    <div class="comment-prev-next-links"></div>
 
    <div class="comment-wrapp">
 
      <div class="meta">
 
          <div style="float:left">
0 comments (0 inline, 0 general)