diff options
Diffstat (limited to 'app/assets/javascripts/importer_status.js')
-rw-r--r-- | app/assets/javascripts/importer_status.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/app/assets/javascripts/importer_status.js b/app/assets/javascripts/importer_status.js index 9efad1ce943..4aced1e618f 100644 --- a/app/assets/javascripts/importer_status.js +++ b/app/assets/javascripts/importer_status.js @@ -10,24 +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, target_namespace; + var $btn, $namespace_input, $target_field, $tr, id, target_namespace, newName; $btn = $(e.currentTarget); $tr = $btn.closest('tr'); $target_field = $tr.find('.import-target'); - $namespace_input = $target_field.find('input'); + $namespace_input = $target_field.find('.js-select-namespace option:selected'); id = $tr.attr('id').replace('repo_', ''); target_namespace = null; - + newName = null; if ($namespace_input.length > 0) { - target_namespace = $namespace_input.prop('value'); - $target_field.empty().append(target_namespace + "/" + ($target_field.data('project_name'))); + target_namespace = $namespace_input[0].innerHTML; + newName = $target_field.find('#path').prop('value'); + $target_field.empty().append(target_namespace + "/" + newName); } - $btn.disable().addClass('is-loading'); - return $.post(_this.import_url, { repo_id: id, - target_namespace: target_namespace + target_namespace: target_namespace, + new_name: newName }, { dataType: 'script' }); |