perf: only generate data-comment-url once (#17618)

This commit is contained in:
Gusted 2021-11-14 05:28:57 +00:00 committed by GitHub
parent 424959e07c
commit 8eddb75508
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View file

@ -517,7 +517,7 @@ export function initRepoPullRequestReview() {
const td = ntr.find(`.add-comment-${side}`);
let commentCloud = td.find('.comment-code-cloud');
if (commentCloud.length === 0 && !ntr.find('button[name="is_review"]').length) {
const data = await $.get($(this).data('new-comment-url'));
const data = await $.get($(this).closest('[data-new-comment-url]').data('new-comment-url'));
td.html(data);
commentCloud = td.find('.comment-code-cloud');
assignMenuAttributes(commentCloud.find('.menu'));