Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2022-07-05 13:20:03 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2022-07-05 13:20:03 +0300
commitd2612b42b9da6638d70b9d7144f6d427070d042d (patch)
treeed7de87d4b112cae8a45ba186d717ca9768c7d4e /app/assets/javascripts/projects
parentd80373b353005e70f44eca8a3bc4a4c5cfbf0e9e (diff)
Add latest changes from gitlab-org/gitlab@15-1-stable-ee
Diffstat (limited to 'app/assets/javascripts/projects')
-rw-r--r--app/assets/javascripts/projects/project_new.js35
1 files changed, 20 insertions, 15 deletions
diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js
index 2c2f957a75d..186946a83ad 100644
--- a/app/assets/javascripts/projects/project_new.js
+++ b/app/assets/javascripts/projects/project_new.js
@@ -276,28 +276,33 @@ const bindEvents = () => {
);
let isProjectImportUrlDirty = false;
- $projectImportUrl.addEventListener('blur', () => {
- isProjectImportUrlDirty = true;
- debouncedUpdateUrlPathWarningVisibility();
- });
- $projectImportUrl.addEventListener('keyup', () => {
- deriveProjectPathFromUrl($projectImportUrl);
- });
+
+ if ($projectImportUrl) {
+ $projectImportUrl.addEventListener('blur', () => {
+ isProjectImportUrlDirty = true;
+ debouncedUpdateUrlPathWarningVisibility();
+ });
+ $projectImportUrl.addEventListener('keyup', () => {
+ deriveProjectPathFromUrl($projectImportUrl);
+ });
+ }
[$projectImportUrl, $projectImportUrlUser, $projectImportUrlPassword].forEach(($f) => {
- if ($f?.on) {
- $f.on('input', () => {
- if (isProjectImportUrlDirty) {
- debouncedUpdateUrlPathWarningVisibility();
- }
- });
- } else {
- $f.addEventListener('input', () => {
+ if (!$f) return false;
+
+ if ($f.on) {
+ return $f.on('input', () => {
if (isProjectImportUrlDirty) {
debouncedUpdateUrlPathWarningVisibility();
}
});
}
+
+ return $f.addEventListener('input', () => {
+ if (isProjectImportUrlDirty) {
+ debouncedUpdateUrlPathWarningVisibility();
+ }
+ });
});
$projectImportForm.on('submit', async (e) => {