summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/profile.js.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'app/assets/javascripts/profile.js.coffee')
-rw-r--r--app/assets/javascripts/profile.js.coffee10
1 files changed, 9 insertions, 1 deletions
diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee
index 69d590a7533..9110b732adc 100644
--- a/app/assets/javascripts/profile.js.coffee
+++ b/app/assets/javascripts/profile.js.coffee
@@ -48,7 +48,7 @@ class @Profile
$filename.text($filename.data('label'))
$('.js-upload-user-avatar').on 'click', ->
- $('.edit_user').submit()
+ $('.edit-user').submit()
$avatarInput.on "change", ->
form = $(this).closest("form")
@@ -63,3 +63,11 @@ class @Profile
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()