1
1
mirror of https://github.com/go-gitea/gitea synced 2024-12-22 16:44:26 +00:00

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>
This commit is contained in:
Yarden Shoham 2024-03-22 21:56:38 +02:00 committed by GitHub
parent 04f9ad0568
commit 5c91d7920f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();