diff options
author | Bryce Johnson <bryce@gitlab.com> | 2016-09-09 16:57:13 +0200 |
---|---|---|
committer | Bryce Johnson <bryce@gitlab.com> | 2016-10-05 11:25:02 +0200 |
commit | 13182a9c5c97b9e104e9efcda203d8b566b72f28 (patch) | |
tree | eb5da355c1e6edf24160b75c563f313260088e6b /app/assets/javascripts/profile | |
parent | b690c19dbf9a74e356b75e1da63f7dcf237a8c81 (diff) | |
download | gitlab-ce-13182a9c5c97b9e104e9efcda203d8b566b72f28.tar.gz |
Make use of destructuring options, clean up based on feedback.
Diffstat (limited to 'app/assets/javascripts/profile')
-rw-r--r-- | app/assets/javascripts/profile/profile.js.es6 | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/app/assets/javascripts/profile/profile.js.es6 b/app/assets/javascripts/profile/profile.js.es6 index e62e0a89867..5b1a5920c95 100644 --- a/app/assets/javascripts/profile/profile.js.es6 +++ b/app/assets/javascripts/profile/profile.js.es6 @@ -1,9 +1,9 @@ ((global) => { class Profile { - constructor(opts = {}) { + constructor({ form = $('.edit-user') }) { this.onSubmitForm = this.onSubmitForm.bind(this); - this.form = opts.form || $('.edit-user'); + this.form = form; this.bindEvents(); this.initAvatarGlCrop(); } @@ -72,12 +72,8 @@ dataType: "json", processData: false, contentType: false, - success: (response) => { - return new Flash(response.message, 'notice'); - }, - error: (jqXHR) => { - return new Flash(jqXHR.responseJSON.message, 'alert'); - }, + success: response => new Flash(response.message, 'notice'), + error: jqXHR => new Flash(jqXHR.responseJSON.message, 'alert'), complete: () => { window.scrollTo(0, 0); // Enable submit button after requests ends |