Changeset - c3d9cd8c0cba
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 14 years ago 2011-11-13 15:56:41
marcin@python-works.com
fixed inline comment file parsing
1 file changed with 4 insertions and 4 deletions:
0 comments (0 inline, 0 general)
rhodecode/public/js/rhodecode.js
Show inline comments
 
@@ -307,32 +307,32 @@ var removeInlineForm = function(form) {
 
var createInlineForm = function(parent_tr, f_path, line) {
 
	var form = document.createElement('tr');
 
	YUD.addClass(form, 'comment-form-inline');
 
	var tmpl = YUD.get('comment-inline-form-template').innerHTML;
 
	tmpl = tmpl.format(f_path, line);
 
	form.innerHTML = '<td class="lineno new"></td>'+
 
		             '<td class="lineno old"></td>'+ 
 
			         '<td>{0}</td>'.format(tmpl);
 

	
 
	// create event for hide button
 
	form = new YAHOO.util.Element(form);
 
	var form_hide_button = new YAHOO.util.Element(form.getElementsByClassName('hide-inline-form')[0]);
 
	form_hide_button.on('click', function(e) {
 
		var newtr = e.currentTarget.parentNode.parentNode.parentNode.parentNode.parentNode;
 
		removeInlineForm(newtr);
 
		YUD.removeClass(parent_tr, 'form-open');
 
	});
 
	return form
 
}
 
var getLineNo = function(tr) {
 
	var line;
 
	var o = tr.children[0].id.split('_');
 
	var n = tr.children[1].id.split('_');
 

	
 
	if (n.length == 2) {
 
		line = n[1];
 
	} else if (o.length == 2) {
 
		line = o[1];
 
	if (n.length >= 2) {
 
		line = n[n.length-1];
 
	} else if (o.length >= 2) {
 
		line = o[n.length-1];
 
	}
 

	
 
	return line
 
}
 
\ No newline at end of file
0 comments (0 inline, 0 general)