summaryrefslogtreecommitdiff
path: root/app/assets
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2016-03-03 15:10:15 -0500
committerRobert Speicher <rspeicher@gmail.com>2016-03-03 16:13:56 -0500
commit9db57bc65a53b19714e7b867bdb75c85058013cf (patch)
tree70b37f54c71302d4bada6d502c939cd187a0dc3c /app/assets
parent2c760487be653a3cc4f9214a72d9c9149147263e (diff)
downloadgitlab-ce-9db57bc65a53b19714e7b867bdb75c85058013cf.tar.gz
Move SSH key JS to Profile CS class
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/profile.js.coffee9
1 files changed, 9 insertions, 0 deletions
diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee
index 15fd9e99ce9..9110b732adc 100644
--- a/app/assets/javascripts/profile.js.coffee
+++ b/app/assets/javascripts/profile.js.coffee
@@ -62,3 +62,12 @@ class @Profile
$modalCropImg.attr('src', event.target.result)
fileData = reader.readAsDataURL(this.files[0])
+
+$ ->
+ # Extract the SSH Key title from its comment
+ $(document).on 'focusout.ssh_key', '#key_key', ->
+ $title = $('#key_title')
+ comment = $(@).val().match(/^\S+ \S+ (.+)\n?$/)
+
+ if comment && comment.length > 1 && $title.val() == ''
+ $title.val(comment[1]).change()