Browse Source

Focus existing comment reply box if one exists

merge-requests/48/head
Jared McAteer 6 years ago
committed by Deimos
parent
commit
f26dadb0c1
  1. 5
      tildes/static/js/behaviors/comment-reply-button.js

5
tildes/static/js/behaviors/comment-reply-button.js

@ -25,6 +25,11 @@ $.onmount('[data-js-comment-reply-button]', function() {
var postURL = '/api/web/comments/' + parentCommentID + '/replies'; var postURL = '/api/web/comments/' + parentCommentID + '/replies';
var markdownID = 'markdown-reply-' + parentCommentID; var markdownID = 'markdown-reply-' + parentCommentID;
if ($('#' + markdownID).length > 0) {
$('#' + markdownID).focus();
return;
}
var replyForm = document.createElement('form'); var replyForm = document.createElement('form');
replyForm.setAttribute('method', 'post'); replyForm.setAttribute('method', 'post');
replyForm.setAttribute('autocomplete', 'off'); replyForm.setAttribute('autocomplete', 'off');

Loading…
Cancel
Save