Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate project board when hitting enter key #27746

Merged
merged 2 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 0 additions & 14 deletions web_src/js/features/repo-projects.js
Original file line number Diff line number Diff line change
Expand Up @@ -193,20 +193,6 @@ export function initRepoProject() {
const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput);
});

$('.new-project-column').on('input keyup', (e) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why input event is also removed?

Copy link
Member Author

@lng2020 lng2020 Oct 23, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not working. The input event is to enable/disable the confirm button. But the confirm button is not disabled at the first place. We don't use this kind of enable/disable attribute in other buttons either. So I removed it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The frontend and backend are both introduced in the PR that implements the Project feature. So It has some personal code style. As I said in the description, It would be great if this part of frontend code is refactored to align other POST forms that we used in Gitea.

const columnTitle = $('#new_project_column');
const projectColorInput = $('#new_project_column_color_picker');
if (!columnTitle.val()) {
$('#new_project_column_submit').addClass('disabled');
return;
}
$('#new_project_column_submit').removeClass('disabled');
if (e.key === 'Enter') {
const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput);
}
});
}

function setLabelColor(label, color) {
Expand Down