trim(document.getElementById('comment_'+commentId+'_body').innerHTML);
commentToEditId = commentId;
+ document.getElementById('commentToEditTitle').focus();
redrawEditor();
- document.onchange = redrawEditor;
+ window.onresize = redrawEditor;
}
function hideEditCommentEditor() {
target: '#display_comments_div'
});
- function showCommentEditor(commentTitle, commentBody) {
- document.getElementById('commentTitle').value=commentTitle;
- document.getElementById(currentRTE).contentDocument.body.innerHTML=commentBody;
+ function showCommentEditor() {
+ document.getElementById('commentTitle').value='';
+ document.getElementById(currentRTE).contentDocument.body.innerHTML='';
document.getElementById('add_comment_button_div').style.display = 'none';
document.getElementById('add_comment_div').style.display = 'block';
+ document.getElementById('commentTitle').focus();
}
-
// Bind the add button
- $("#add_comment_button").click(function() {showCommentEditor('','');});
+ $("#add_comment_button").click(showCommentEditor);
function hideCommentEditor() {
document.getElementById("add_comment_button_div").style.display = 'block';