summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2017-02-23 17:48:44 +0000
committerPhil Hughes <me@iamphill.com>2017-02-27 15:25:27 +0000
commite42169c28e14f4dbc6e4d35ae189b73d90278c42 (patch)
tree3e156cb99908fac1eb2d319adc15b625c0e219cf /app
parentd6f18f8e1989aac4b96ad377f854cf2724f77c19 (diff)
downloadgitlab-ce-e42169c28e14f4dbc6e4d35ae189b73d90278c42.tar.gz
Updates SSH key title after pasting key
Previously it was listening for focusout, it now listens for blur & paste events Closes #28436
Diffstat (limited to 'app')
-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();