Changeset - 64d6e8e298a4
[Not reviewed]
default
0 1 0
Mads Kiilerich - 12 years ago 2013-06-17 18:23:13
madski@unity3d.com
comments: don't hide comments made to lines outside the diff context

This is a hack but seems like the best way to solve the problem of users
increasing the context size and then making comments. The way things are done
makes it hard to come up with a better solution.

It should perhaps also be made impossible to comment on lines that isn't
changed in the changeset.

This issue is related to the need for a way to easily navigate to the
(unresolved) comments that has been made on a huge changeset.
1 file changed with 15 insertions and 2 deletions:
0 comments (0 inline, 0 general)
kallithea/public/js/base.js
Show inline comments
 
@@ -803,6 +803,9 @@ var _placeAddButton = function($line_tr)
 
 */
 
var _placeInline = function(target_id, lineno, html){
 
    var $td = $("#{0}_{1}".format(target_id, lineno));
 
    if (!$td.length){
 
        return false;
 
    }
 

	
 
    // check if there are comments already !
 
    var $line_tr = $td.parent(); // the tr
 
@@ -815,6 +818,7 @@ var _placeInline = function(target_id, l
 

	
 
    // scan nodes, and attach add button to last one
 
    _placeAddButton($line_tr);
 
    return true;
 
}
 

	
 
/**
 
@@ -824,7 +828,7 @@ var _renderInlineComment = function(json
 
    var html =  json_data['rendered_text'];
 
    var lineno = json_data['line_no'];
 
    var target_id = json_data['target_id'];
 
    _placeInline(target_id, lineno, html);
 
    return _placeInline(target_id, lineno, html);
 
}
 

	
 
/**
 
@@ -844,8 +848,17 @@ var renderInlineComments = function(file
 
                'line_no': $(comments[i]).attr('line'),
 
                'target_id': target_id
 
            }
 
            _renderInlineComment(data);
 
            if (_renderInlineComment(data)) {
 
                $(comments[i]).hide();
 
            }else{
 
                var txt = document.createTextNode(
 
                        "Comment to " + YUD.getAttribute(comments[i].parentNode,'path') +
 
                        " line " + data.line_no +
 
                        " which is outside the diff context:");
 
                comments[i].insertBefore(txt, comments[i].firstChild);
 
            }
 
        }
 
        $(box).show();
 
    }
 
}
 

	
0 comments (0 inline, 0 general)