diff options
Diffstat (limited to 'web_src/js/features/repo-diff.js')
-rw-r--r-- | web_src/js/features/repo-diff.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/web_src/js/features/repo-diff.js b/web_src/js/features/repo-diff.js index f8f6c38b76..d2502315b4 100644 --- a/web_src/js/features/repo-diff.js +++ b/web_src/js/features/repo-diff.js @@ -1,5 +1,6 @@ import {initCompReactionSelector} from './comp/ReactionSelector.js'; import {initRepoIssueContentHistory} from './repo-issue-content.js'; +import {validateTextareaNonEmpty} from './comp/CommentEasyMDE.js'; const {csrfToken} = window.config; export function initRepoDiffReviewButton() { @@ -23,7 +24,13 @@ export function initRepoDiffFileViewToggle() { export function initRepoDiffConversationForm() { $(document).on('submit', '.conversation-holder form', async (e) => { e.preventDefault(); + const form = $(e.target); + const $textArea = form.find('textarea'); + if (!validateTextareaNonEmpty(form, $textArea)) { + return; + } + const newConversationHolder = $(await $.post(form.attr('action'), form.serialize())); const {path, side, idx} = newConversationHolder.data(); |