Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <lacerda.filipa@gmail.com>2017-02-27 19:45:46 +0300
committerFilipa Lacerda <lacerda.filipa@gmail.com>2017-02-27 19:45:46 +0300
commit883342ce36b5f38156a3376af7d8a2e274163917 (patch)
tree707df8270e00c78004775f84422a88ccf6f43d61 /app/assets
parent23659c52daf42a343a005924615cf428b8a2d7a2 (diff)
parente42169c28e14f4dbc6e4d35ae189b73d90278c42 (diff)
Merge branch 'ssh-key-paste' into 'master'
Updates SSH key title after pasting key Closes #28436 See merge request !9481
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/profile/profile.js.es67
1 files changed, 4 insertions, 3 deletions
diff --git a/app/assets/javascripts/profile/profile.js.es6 b/app/assets/javascripts/profile/profile.js.es6
index 81374296522..4ccea0624ee 100644
--- a/app/assets/javascripts/profile/profile.js.es6
+++ b/app/assets/javascripts/profile/profile.js.es6
@@ -84,13 +84,14 @@
}
$(function() {
- $(document).on('focusout.ssh_key', '#key_key', function() {
+ $(document).on('input.ssh_key', '#key_key', function() {
const $title = $('#key_title');
const comment = $(this).val().match(/^\S+ \S+ (.+)\n?$/);
- if (comment && comment.length > 1 && $title.val() === '') {
+
+ // Extract the SSH Key title from its comment
+ if (comment && comment.length > 1) {
return $title.val(comment[1]).change();
}
- // Extract the SSH Key title from its comment
});
if (global.utils.getPagePath() === 'profiles') {
return new Profile();