Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
gitlab-ce
Commits
2467852c
Commit
2467852c
authored
Mar 20, 2018
by
Phil Hughes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove JS for cookie toggle
parent
e8b85811
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
22 deletions
+19
-22
app/assets/javascripts/profile/profile.js
app/assets/javascripts/profile/profile.js
+19
-22
No files found.
app/assets/javascripts/profile/profile.js
View file @
2467852c
/* eslint-disable comma-dangle, no-unused-vars, class-methods-use-this, quotes, consistent-return, func-names, prefer-arrow-callback, space-before-function-paren, max-len */
/* eslint-disable comma-dangle, no-unused-vars, class-methods-use-this, quotes, consistent-return, func-names, prefer-arrow-callback, space-before-function-paren, max-len */
import
$
from
'
jquery
'
;
import
$
from
'
jquery
'
;
import
Cookies
from
'
js-cookie
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
axios
from
'
~/lib/utils/axios_utils
'
;
import
{
__
}
from
'
~/locale
'
;
import
{
__
}
from
'
~/locale
'
;
import
flash
from
'
../flash
'
;
import
flash
from
'
../flash
'
;
...
@@ -10,7 +9,6 @@ export default class Profile {
...
@@ -10,7 +9,6 @@ export default class Profile {
constructor
({
form
}
=
{})
{
constructor
({
form
}
=
{})
{
this
.
onSubmitForm
=
this
.
onSubmitForm
.
bind
(
this
);
this
.
onSubmitForm
=
this
.
onSubmitForm
.
bind
(
this
);
this
.
form
=
form
||
$
(
'
.edit-user
'
);
this
.
form
=
form
||
$
(
'
.edit-user
'
);
this
.
newRepoActivated
=
Cookies
.
get
(
'
new_repo
'
);
this
.
setRepoRadio
();
this
.
setRepoRadio
();
this
.
bindEvents
();
this
.
bindEvents
();
this
.
initAvatarGlCrop
();
this
.
initAvatarGlCrop
();
...
@@ -23,21 +21,28 @@ export default class Profile {
...
@@ -23,21 +21,28 @@ export default class Profile {
modalCrop
:
'
.modal-profile-crop
'
,
modalCrop
:
'
.modal-profile-crop
'
,
pickImageEl
:
'
.js-choose-user-avatar-button
'
,
pickImageEl
:
'
.js-choose-user-avatar-button
'
,
uploadImageBtn
:
'
.js-upload-user-avatar
'
,
uploadImageBtn
:
'
.js-upload-user-avatar
'
,
modalCropImg
:
'
.modal-profile-crop-image
'
modalCropImg
:
'
.modal-profile-crop-image
'
,
};
};
this
.
avatarGlCrop
=
$
(
'
.js-user-avatar-input
'
).
glCrop
(
cropOpts
).
data
(
'
glcrop
'
);
this
.
avatarGlCrop
=
$
(
'
.js-user-avatar-input
'
)
.
glCrop
(
cropOpts
)
.
data
(
'
glcrop
'
);
}
}
bindEvents
()
{
bindEvents
()
{
$
(
'
.js-preferences-form
'
).
on
(
'
change.preference
'
,
'
input[type=radio]
'
,
this
.
submitForm
);
$
(
'
.js-preferences-form
'
).
on
(
$
(
'
input[name="user[multi_file]"]
'
).
on
(
'
change
'
,
this
.
setNewRepoCookie
);
'
change.preference
'
,
'
input[type=radio]
'
,
this
.
submitForm
,
);
$
(
'
#user_notification_email
'
).
on
(
'
change
'
,
this
.
submitForm
);
$
(
'
#user_notification_email
'
).
on
(
'
change
'
,
this
.
submitForm
);
$
(
'
#user_notified_of_own_activity
'
).
on
(
'
change
'
,
this
.
submitForm
);
$
(
'
#user_notified_of_own_activity
'
).
on
(
'
change
'
,
this
.
submitForm
);
this
.
form
.
on
(
'
submit
'
,
this
.
onSubmitForm
);
this
.
form
.
on
(
'
submit
'
,
this
.
onSubmitForm
);
}
}
submitForm
()
{
submitForm
()
{
return
$
(
this
).
parents
(
'
form
'
).
submit
();
return
$
(
this
)
.
parents
(
'
form
'
)
.
submit
();
}
}
onSubmitForm
(
e
)
{
onSubmitForm
(
e
)
{
...
@@ -59,21 +64,13 @@ export default class Profile {
...
@@ -59,21 +64,13 @@ export default class Profile {
url
:
this
.
form
.
attr
(
'
action
'
),
url
:
this
.
form
.
attr
(
'
action
'
),
data
:
formData
,
data
:
formData
,
})
})
.
then
(({
data
})
=>
flash
(
data
.
message
,
'
notice
'
))
.
then
(({
data
})
=>
flash
(
data
.
message
,
'
notice
'
))
.
then
(()
=>
{
.
then
(()
=>
{
window
.
scrollTo
(
0
,
0
);
window
.
scrollTo
(
0
,
0
);
// Enable submit button after requests ends
// Enable submit button after requests ends
self
.
form
.
find
(
'
:input[disabled]
'
).
enable
();
self
.
form
.
find
(
'
:input[disabled]
'
).
enable
();
})
})
.
catch
(
error
=>
flash
(
error
.
message
));
.
catch
(
error
=>
flash
(
error
.
message
));
}
setNewRepoCookie
()
{
if
(
this
.
value
===
'
off
'
)
{
Cookies
.
remove
(
'
new_repo
'
);
}
else
{
Cookies
.
set
(
'
new_repo
'
,
true
,
{
expires_in
:
365
});
}
}
}
setRepoRadio
()
{
setRepoRadio
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment