diff options
author | Jose Ivan Vargas <jvargas@gitlab.com> | 2017-12-22 21:25:24 +0300 |
---|---|---|
committer | Jose Ivan Vargas <jvargas@gitlab.com> | 2018-01-03 18:51:57 +0300 |
commit | 0d6b9e30cb5c3b76ee97cd14dea1dae12a74e8d6 (patch) | |
tree | 307bd809d5ea4be7bf61204e942eb0f9d1c85a3a /app/assets/javascripts/projects/project_new.js | |
parent | e5a9b9a14d32d890dea20403c977dfd569eb3e17 (diff) |
Fix import project url not updating project name
Diffstat (limited to 'app/assets/javascripts/projects/project_new.js')
-rw-r--r-- | app/assets/javascripts/projects/project_new.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/projects/project_new.js b/app/assets/javascripts/projects/project_new.js index 3ecc0c2a6e5..4710e70d619 100644 --- a/app/assets/javascripts/projects/project_new.js +++ b/app/assets/javascripts/projects/project_new.js @@ -1,6 +1,7 @@ let hasUserDefinedProjectPath = false; -const deriveProjectPathFromUrl = ($projectImportUrl, $projectPath) => { +const deriveProjectPathFromUrl = ($projectImportUrl) => { + const $currentProjectPath = $projectImportUrl.parents('.toggle-import-form').find('#project_path'); if (hasUserDefinedProjectPath) { return; } @@ -21,7 +22,7 @@ const deriveProjectPathFromUrl = ($projectImportUrl, $projectPath) => { // extract everything after the last slash const pathMatch = /\/([^/]+)$/.exec(importUrl); if (pathMatch) { - $projectPath.val(pathMatch[1]); + $currentProjectPath.val(pathMatch[1]); } }; @@ -96,7 +97,7 @@ const bindEvents = () => { hasUserDefinedProjectPath = $projectPath.val().trim().length > 0; }); - $projectImportUrl.keyup(() => deriveProjectPathFromUrl($projectImportUrl, $projectPath)); + $projectImportUrl.keyup(() => deriveProjectPathFromUrl($projectImportUrl)); }; document.addEventListener('DOMContentLoaded', bindEvents); |