diff --git a/parser.js b/parser.js index f4a34e9..4b3debd 100755 --- a/parser.js +++ b/parser.js @@ -464,8 +464,12 @@ function addComment(e){ if(postNBody.isBeenCommented === true)return; postNBody.isBeenCommented = true; var nodeComment = gNodes['comment'].cloneAll(); - nodeComment.cNodes['comment-body'].appendChild(genEditNode(postNewComment,cancelNewComment)); + var nodeEdit = genEditNode(postNewComment,cancelNewComment); + var field_id = e.target.parentNode.parentNode.parentNode.parentNode.parentNode.id+'_com'; + nodeEdit.id = field_id; + nodeComment.cNodes['comment-body'].appendChild(nodeEdit); postNBody.cNodes['comments'].appendChild(nodeComment); + document.getElementById(field_id).childNodes[0].focus(); } function editComment(e){ var victim = e.target; do victim = victim.parentNode; while(victim.className != 'comment');