diff --git a/public/js/index.js b/public/js/index.js index 2e0e26f55c45..f443e52436de 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -1491,10 +1491,10 @@ $(function () { // Parse SSH Key $("#ssh-key-content").on('change paste keyup',function(){ - var value = $(this).val(); - var arrays = value.split(" "); - if (arrays.length === 3 && arrays[2] !== "") { - $("#ssh-key-title").val(arrays[2]); + var arrays = $(this).val().split(" "); + var $title = $("#ssh-key-title") + if ($title.val() === "" && arrays.length === 3 && arrays[2] !== "") { + $title.val(arrays[2]); } }); }); diff --git a/templates/repo/settings/deploy_keys.tmpl b/templates/repo/settings/deploy_keys.tmpl index 1f6b26a6da36..6f419c894adc 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -57,11 +57,11 @@