mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-10 12:15:43 +01: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> (cherry picked from commit 5c91d7920f4aff08768e274269e211e926aa3d36)
This commit is contained in:
parent
3ea7437fa6
commit
c3e9b8b6f9
1 changed files with 4 additions and 4 deletions
|
@ -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 a new issue