Skip to content

Commit

Permalink
Merge pull request #7 from payalnik/master
Browse files Browse the repository at this point in the history
comment focusing
  • Loading branch information
SiTLar committed Jun 4, 2015
2 parents 30d4f7f + 696f93d commit 1be45ef
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 1be45ef

Please sign in to comment.