aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js
diff options
context:
space:
mode:
authorNanguan Lin <70063547+lng2020@users.noreply.github.com>2023-10-23 20:40:33 +0800
committerGitHub <noreply@github.com>2023-10-23 12:40:33 +0000
commit51d1dc22ff94b561b1a3c00f8eb8ac04a4ee2674 (patch)
treeacb827c6eb9363e01cc4cf8b196f1353e2f64f81 /web_src/js
parent61d94b247ab0c9289cd04253fed78283300e8c5e (diff)
downloadgitea-51d1dc22ff94b561b1a3c00f8eb8ac04a4ee2674.tar.gz
gitea-51d1dc22ff94b561b1a3c00f8eb8ac04a4ee2674.zip
Fix duplicate project board when hitting `enter` key (#27746)
When hitting the `enter` key to create a new project column, the request is sent twice because the `submit` event and `key up` event are both triggered. Probably a better solution is to rewrite these parts of the code to avoid using native jQuery but reuse the `form-fetch-action` class. But it's beyond my ability.
Diffstat (limited to 'web_src/js')
-rw-r--r--web_src/js/features/repo-projects.js14
1 files changed, 0 insertions, 14 deletions
diff --git a/web_src/js/features/repo-projects.js b/web_src/js/features/repo-projects.js
index f12d4f234f..5a2a7e72ef 100644
--- a/web_src/js/features/repo-projects.js
+++ b/web_src/js/features/repo-projects.js
@@ -193,20 +193,6 @@ export function initRepoProject() {
const url = $(this).data('url');
createNewColumn(url, columnTitle, projectColorInput);
});
-
- $('.new-project-column').on('input keyup', (e) => {
- 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) {