diff --git a/public/js/index.js b/public/js/index.js index 2e0e26f55..f443e5243 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 1f6b26a6d..6f419c894 100644 --- a/templates/repo/settings/deploy_keys.tmpl +++ b/templates/repo/settings/deploy_keys.tmpl @@ -57,11 +57,11 @@