|
|
@ -1,5 +1,6 @@ |
|
|
|
import {initCompReactionSelector} from './comp/ReactionSelector.js'; |
|
|
|
import {initCompReactionSelector} from './comp/ReactionSelector.js'; |
|
|
|
import {initRepoIssueContentHistory} from './repo-issue-content.js'; |
|
|
|
import {initRepoIssueContentHistory} from './repo-issue-content.js'; |
|
|
|
|
|
|
|
import {validateTextareaNonEmpty} from './comp/CommentEasyMDE.js'; |
|
|
|
const {csrfToken} = window.config; |
|
|
|
const {csrfToken} = window.config; |
|
|
|
|
|
|
|
|
|
|
|
export function initRepoDiffReviewButton() { |
|
|
|
export function initRepoDiffReviewButton() { |
|
|
@ -23,7 +24,13 @@ export function initRepoDiffFileViewToggle() { |
|
|
|
export function initRepoDiffConversationForm() { |
|
|
|
export function initRepoDiffConversationForm() { |
|
|
|
$(document).on('submit', '.conversation-holder form', async (e) => { |
|
|
|
$(document).on('submit', '.conversation-holder form', async (e) => { |
|
|
|
e.preventDefault(); |
|
|
|
e.preventDefault(); |
|
|
|
|
|
|
|
|
|
|
|
const form = $(e.target); |
|
|
|
const form = $(e.target); |
|
|
|
|
|
|
|
const $textArea = form.find('textarea'); |
|
|
|
|
|
|
|
if (!validateTextareaNonEmpty(form, $textArea)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const newConversationHolder = $(await $.post(form.attr('action'), form.serialize())); |
|
|
|
const newConversationHolder = $(await $.post(form.attr('action'), form.serialize())); |
|
|
|
const {path, side, idx} = newConversationHolder.data(); |
|
|
|
const {path, side, idx} = newConversationHolder.data(); |
|
|
|
|
|
|
|
|
|
|
|