diff options
author | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-30 14:34:37 -0300 |
---|---|---|
committer | Douglas Barbosa Alexandre <dbalexandre@gmail.com> | 2016-08-31 16:54:15 -0300 |
commit | e293ffd48fb16c8ad15c066cfbbe1dcead7c52e0 (patch) | |
tree | 629ff34656b234911843e0230cdbe330731b05ea /app/assets | |
parent | 325de662ce79ea75348c303e05b2f0045835193e (diff) | |
download | gitlab-ce-e293ffd48fb16c8ad15c066cfbbe1dcead7c52e0.tar.gz |
Refactoring Import::BaseController#find_or_create_namespace
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/importer_status.js | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/app/assets/javascripts/importer_status.js b/app/assets/javascripts/importer_status.js index 0f840821f53..9efad1ce943 100644 --- a/app/assets/javascripts/importer_status.js +++ b/app/assets/javascripts/importer_status.js @@ -10,21 +10,24 @@ ImporterStatus.prototype.initStatusPage = function() { $('.js-add-to-import').off('click').on('click', (function(_this) { return function(e) { - var $btn, $namespace_input, $target_field, $tr, id, new_namespace; + var $btn, $namespace_input, $target_field, $tr, id, target_namespace; $btn = $(e.currentTarget); $tr = $btn.closest('tr'); $target_field = $tr.find('.import-target'); $namespace_input = $target_field.find('input'); id = $tr.attr('id').replace('repo_', ''); - new_namespace = null; + target_namespace = null; + if ($namespace_input.length > 0) { - new_namespace = $namespace_input.prop('value'); - $target_field.empty().append(new_namespace + "/" + ($target_field.data('project_name'))); + target_namespace = $namespace_input.prop('value'); + $target_field.empty().append(target_namespace + "/" + ($target_field.data('project_name'))); } + $btn.disable().addClass('is-loading'); + return $.post(_this.import_url, { repo_id: id, - new_namespace: new_namespace + target_namespace: target_namespace }, { dataType: 'script' }); @@ -70,7 +73,7 @@ if ($('.js-importer-status').length) { var jobsImportPath = $('.js-importer-status').data('jobs-import-path'); var importPath = $('.js-importer-status').data('import-path'); - + new ImporterStatus(jobsImportPath, importPath); } }); |