aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features/repo-issue.js
diff options
context:
space:
mode:
Diffstat (limited to 'web_src/js/features/repo-issue.js')
-rw-r--r--web_src/js/features/repo-issue.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/web_src/js/features/repo-issue.js b/web_src/js/features/repo-issue.js
index 1476571cc7..b224245fdf 100644
--- a/web_src/js/features/repo-issue.js
+++ b/web_src/js/features/repo-issue.js
@@ -182,7 +182,8 @@ export function initRepoIssueCommentDelete() {
export function initRepoIssueDependencyDelete() {
// Delete Issue dependency
$(document).on('click', '.delete-dependency-button', (e) => {
- const {id, type} = e.currentTarget.dataset;
+ const id = e.currentTarget.getAttribute('data-id');
+ const type = e.currentTarget.getAttribute('data-type');
$('.remove-dependency').modal({
closable: false,
@@ -348,22 +349,19 @@ export async function updateIssuesMeta(url, action, issueIds, elementId) {
export function initRepoIssueComments() {
if ($('.repository.view.issue .timeline').length === 0) return;
- $('.re-request-review').on('click', function (event) {
+ $('.re-request-review').on('click', function (e) {
+ e.preventDefault();
const url = $(this).data('update-url');
const issueId = $(this).data('issue-id');
const id = $(this).data('id');
const isChecked = $(this).hasClass('checked');
- event.preventDefault();
updateIssuesMeta(
url,
isChecked ? 'detach' : 'attach',
issueId,
id,
- ).then(() => {
- window.location.reload();
- });
- return false;
+ ).then(() => window.location.reload()); // eslint-disable-line github/no-then
});
$('.dismiss-review-btn').on('click', function (e) {
@@ -550,7 +548,10 @@ export function initRepoIssueWipToggle() {
// Toggle WIP
$('.toggle-wip a, .toggle-wip button').on('click', async (e) => {
e.preventDefault();
- const {title, wipPrefix, updateUrl} = e.currentTarget.closest('.toggle-wip').dataset;
+ const toggleWip = e.currentTarget.closest('.toggle-wip');
+ const title = toggleWip.getAttribute('data-title');
+ const wipPrefix = toggleWip.getAttribute('data-wip-prefix');
+ const updateUrl = toggleWip.getAttribute('data-update-url');
await $.post(updateUrl, {
_csrf: csrfToken,
title: title?.startsWith(wipPrefix) ? title.substr(wipPrefix.length).trim() : `${wipPrefix.trim()} ${title}`,