Skip to content

Commit 5c91d79

Browse files
yardenshohamwxiaoguangGiteaBot
authored
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 <[email protected]> Co-authored-by: wxiaoguang <[email protected]> Co-authored-by: Giteabot <[email protected]>
1 parent 04f9ad0 commit 5c91d79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web_src/js/features/repo-projects.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ async function moveIssue({item, from, to, oldIndex}) {
3333

3434
const columnSorting = {
3535
issues: Array.from(columnCards, (card, i) => ({
36-
issueID: parseInt($(card).attr('data-issue')),
36+
issueID: parseInt(card.getAttribute('data-issue')),
3737
sorting: i,
3838
})),
3939
};
@@ -134,7 +134,7 @@ export function initRepoProject() {
134134
if ($projectColorInput.val()) {
135135
setLabelColor($projectHeader, $projectColorInput.val());
136136
}
137-
$boardColumn.attr('style', `background: ${$projectColorInput.val()}!important`);
137+
$boardColumn[0].style = `background: ${$projectColorInput.val()} !important`;
138138
$('.ui.modal').modal('hide');
139139
}
140140
});
@@ -159,9 +159,9 @@ export function initRepoProject() {
159159
});
160160

161161
$('.show-delete-project-column-modal').each(function () {
162-
const $deleteColumnModal = $(`${$(this).attr('data-modal')}`);
162+
const $deleteColumnModal = $(`${this.getAttribute('data-modal')}`);
163163
const $deleteColumnButton = $deleteColumnModal.find('.actions > .ok.button');
164-
const deleteUrl = $(this).attr('data-url');
164+
const deleteUrl = this.getAttribute('data-url');
165165

166166
$deleteColumnButton.on('click', async (e) => {
167167
e.preventDefault();

0 commit comments

Comments
 (0)