mirror of
https://github.com/go-gitea/gitea
synced 2024-12-23 00:54:28 +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:
parent
04f9ad0568
commit
5c91d7920f
@ -33,7 +33,7 @@ async function moveIssue({item, from, to, oldIndex}) {
|
|||||||
|
|
||||||
const columnSorting = {
|
const columnSorting = {
|
||||||
issues: Array.from(columnCards, (card, i) => ({
|
issues: Array.from(columnCards, (card, i) => ({
|
||||||
issueID: parseInt($(card).attr('data-issue')),
|
issueID: parseInt(card.getAttribute('data-issue')),
|
||||||
sorting: i,
|
sorting: i,
|
||||||
})),
|
})),
|
||||||
};
|
};
|
||||||
@ -134,7 +134,7 @@ export function initRepoProject() {
|
|||||||
if ($projectColorInput.val()) {
|
if ($projectColorInput.val()) {
|
||||||
setLabelColor($projectHeader, $projectColorInput.val());
|
setLabelColor($projectHeader, $projectColorInput.val());
|
||||||
}
|
}
|
||||||
$boardColumn.attr('style', `background: ${$projectColorInput.val()}!important`);
|
$boardColumn[0].style = `background: ${$projectColorInput.val()} !important`;
|
||||||
$('.ui.modal').modal('hide');
|
$('.ui.modal').modal('hide');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -159,9 +159,9 @@ export function initRepoProject() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$('.show-delete-project-column-modal').each(function () {
|
$('.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 $deleteColumnButton = $deleteColumnModal.find('.actions > .ok.button');
|
||||||
const deleteUrl = $(this).attr('data-url');
|
const deleteUrl = this.getAttribute('data-url');
|
||||||
|
|
||||||
$deleteColumnButton.on('click', async (e) => {
|
$deleteColumnButton.on('click', async (e) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
|
Loading…
Reference in New Issue
Block a user