summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/profile.js.coffee
diff options
context:
space:
mode:
authorSteven Thonus <github@popl.nl>2013-10-06 20:13:56 +0200
committerSteven Thonus <github@popl.nl>2013-10-09 09:05:09 +0200
commit65cad57a35002a9fd168863ae8a4d7ca045fb938 (patch)
tree61227cc71fea23b8f75852cd92452e4f2fd47179 /app/assets/javascripts/profile.js.coffee
parent358426d66164d720d793ea37bacb4fc331c30171 (diff)
downloadgitlab-ce-65cad57a35002a9fd168863ae8a4d7ca045fb938.tar.gz
avatar upload on profile page
Diffstat (limited to 'app/assets/javascripts/profile.js.coffee')
-rw-r--r--app/assets/javascripts/profile.js.coffee10
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee
index e7974611cbe..744f3086d55 100644
--- a/app/assets/javascripts/profile.js.coffee
+++ b/app/assets/javascripts/profile.js.coffee
@@ -16,3 +16,13 @@ $ ->
$('.update-notifications').on 'ajax:complete', ->
$(this).find('.btn-save').enableButton()
+
+
+ $('.js-choose-user-avatar-button').bind "click", ->
+ form = $(this).closest("form")
+ form.find(".js-user-avatar-input").click()
+
+ $('.js-user-avatar-input').bind "change", ->
+ form = $(this).closest("form")
+ filename = $(this).val().replace(/^.*[\\\/]/, '')
+ form.find(".js-avatar-filename").text(filename)