summaryrefslogtreecommitdiff
path: root/app/assets/javascripts/profile.js.coffee
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-02 13:29:24 +0200
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2012-12-02 13:29:24 +0200
commit46bf3a094988327b08c88006c694f0a0a15f7da2 (patch)
tree82458b24bc2d77b1f711bc6579d39080748ab972 /app/assets/javascripts/profile.js.coffee
parent2be5e6d44347dfb6374b4b2c87a953da06d6167d (diff)
downloadgitlab-ce-46bf3a094988327b08c88006c694f0a0a15f7da2.tar.gz
Refactored profile to resource. Added missing flash notice on successfull updated. Update username via ajax
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 e536afad939..42207a390b3 100644
--- a/app/assets/javascripts/profile.js.coffee
+++ b/app/assets/javascripts/profile.js.coffee
@@ -8,3 +8,13 @@ $ ->
# Go up the hierarchy and show the corresponding submission feedback element
$(@).closest('fieldset').find('.update-feedback').show('highlight', {color: '#DFF0D8'}, 500)
+
+ $('.update-username form').on 'ajax:before', ->
+ $('.loading-gif').show()
+ $(this).find('.update-success').hide()
+ $(this).find('.update-failed').hide()
+
+ $('.update-username form').on 'ajax:complete', ->
+ $(this).find('.save-btn').removeAttr('disabled')
+ $(this).find('.save-btn').removeClass('disabled')
+ $(this).find('.loading-gif').hide()