summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorYarden Shoham <git@yardenshoham.com>2024-03-22 21:56:38 +0200
committerGitHub <noreply@github.com>2024-03-22 20:56:38 +0100
commit5c91d7920f4aff08768e274269e211e926aa3d36 (patch)
treed2e2eaf3ddbc1dbb6d104d8e72f7e753d5449339 /web_src
parent04f9ad056882fc3f21b247b16f84437adf0f36d8 (diff)
downloadgitea-5c91d7920f4aff08768e274269e211e926aa3d36.tar.gz
gitea-5c91d7920f4aff08768e274269e211e926aa3d36.zip
Remove jQuery `.attr` from the project page (#30004)
- Switched from jQuery `.attr` to plain javascript `.getAttribute` - Tested the issue movement between columns, column background color setting, and column deletion. It all works as before --------- Signed-off-by: Yarden Shoham <git@yardenshoham.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com> Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'web_src')
-rw-r--r--web_src/js/features/repo-projects.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/web_src/js/features/repo-projects.js b/web_src/js/features/repo-projects.js
index e95d875ec4..fc688bb695 100644
--- a/web_src/js/features/repo-projects.js
+++ b/web_src/js/features/repo-projects.js
@@ -33,7 +33,7 @@ async function moveIssue({item, from, to, oldIndex}) {
const columnSorting = {
issues: Array.from(columnCards, (card, i) => ({
- issueID: parseInt($(card).attr('data-issue')),
+ issueID: parseInt(card.getAttribute('data-issue')),
sorting: i,
})),
};
@@ -134,7 +134,7 @@ export function initRepoProject() {
if ($projectColorInput.val()) {
setLabelColor($projectHeader, $projectColorInput.val());
}
- $boardColumn.attr('style', `background: ${$projectColorInput.val()}!important`);
+ $boardColumn[0].style = `background: ${$projectColorInput.val()} !important`;
$('.ui.modal').modal('hide');
}
});
@@ -159,9 +159,9 @@ export function initRepoProject() {
});
$('.show-delete-project-column-modal').each(function () {
- const $deleteColumnModal = $(`${$(this).attr('data-modal')}`);
+ const $deleteColumnModal = $(`${this.getAttribute('data-modal')}`);
const $deleteColumnButton = $deleteColumnModal.find('.actions > .ok.button');
- const deleteUrl = $(this).attr('data-url');
+ const deleteUrl = this.getAttribute('data-url');
$deleteColumnButton.on('click', async (e) => {
e.preventDefault();