Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryce Johnson <bryce@gitlab.com>2016-09-09 17:57:13 +0300
committerBryce Johnson <bryce@gitlab.com>2016-10-05 12:25:02 +0300
commit13182a9c5c97b9e104e9efcda203d8b566b72f28 (patch)
treeeb5da355c1e6edf24160b75c563f313260088e6b /app/assets/javascripts/profile
parentb690c19dbf9a74e356b75e1da63f7dcf237a8c81 (diff)
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.es612
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