diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-06-05 18:01:45 -0400 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-06-13 17:58:17 -0400 |
commit | 0e21436aaf9ea2ed988c3e515e0db73df70534c4 (patch) | |
tree | d01d9374d58e6eebfc16739c10213fb5df1dc260 /app/assets | |
parent | 5f20574db5c7b91d54e829010c1fda093ea8a25e (diff) | |
download | gitlab-ce-0e21436aaf9ea2ed988c3e515e0db73df70534c4.tar.gz |
Simplify the javascript behavior for Preference updating
Diffstat (limited to 'app/assets')
-rw-r--r-- | app/assets/javascripts/profile.js.coffee | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/app/assets/javascripts/profile.js.coffee b/app/assets/javascripts/profile.js.coffee index a402973a543..bb0b66b86e1 100644 --- a/app/assets/javascripts/profile.js.coffee +++ b/app/assets/javascripts/profile.js.coffee @@ -1,10 +1,8 @@ class @Profile constructor: -> - $('.edit_user .application-theme input, .edit_user .code-preview-theme input').click -> - # Submit the form - $('.edit_user').submit() - - new Flash('Preferences saved.', 'notice') + # Automatically submit the Preferences form when any of its radio buttons change + $('.js-preferences-form').on 'change.preference', 'input[type=radio]', -> + $(this).parents('form').submit() $('.update-username form').on 'ajax:before', -> $('.loading-gif').show() @@ -18,7 +16,6 @@ class @Profile $('.update-notifications').on 'ajax:complete', -> $(this).find('.btn-save').enable() - $('.js-choose-user-avatar-button').bind "click", -> form = $(this).closest("form") form.find(".js-user-avatar-input").click() |