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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
01441f54
Commit
01441f54
authored
Oct 27, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #8120 from cirosantilli/profile-js-only-needed
Only run profile js on pages that need it
parents
367d4db4
93e8a056
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
23 deletions
+29
-23
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+4
-0
app/assets/javascripts/profile.js.coffee
app/assets/javascripts/profile.js.coffee
+22
-23
app/assets/javascripts/user.js.coffee
app/assets/javascripts/user.js.coffee
+3
-0
No files found.
app/assets/javascripts/dispatcher.js.coffee
View file @
01441f54
...
...
@@ -76,6 +76,8 @@ class Dispatcher
# Ensure we don't create a particular shortcut handler here. This is
# already created, where the network graph is created.
shortcut_handler
=
true
when
'users:show'
new
User
()
switch
path
.
first
()
when
'admin'
...
...
@@ -85,6 +87,8 @@ class Dispatcher
new
NamespaceSelect
()
when
'dashboard'
shortcut_handler
=
new
ShortcutsDashboardNavigation
()
when
'profiles'
new
Profile
()
when
'projects'
new
Project
()
switch
path
[
1
]
...
...
app/assets/javascripts/profile.js.coffee
View file @
01441f54
$
->
$
(
'.edit_user .application-theme input, .edit_user .code-preview-theme input'
).
click
->
# Submit the form
$
(
'.edit_user'
).
submit
()
class
@
Profile
constructor
:
->
$
(
'.edit_user .application-theme input, .edit_user .code-preview-theme input'
).
click
->
# Submit the form
$
(
'.edit_user'
).
submit
()
new
Flash
(
"Appearance settings saved"
,
"notice"
)
new
Flash
(
"Appearance settings saved"
,
"notice"
)
$
(
'.update-username form'
).
on
'ajax:before'
,
->
$
(
'.loading-gif'
).
show
()
$
(
this
).
find
(
'.update-success'
).
hide
()
$
(
this
).
find
(
'.update-failed'
).
hide
()
$
(
'.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
(
'.btn-save'
).
enableButton
()
$
(
this
).
find
(
'.loading-gif'
).
hide
()
$
(
'.update-username form'
).
on
'ajax:complete'
,
->
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
this
).
find
(
'.loading-gif'
).
hide
()
$
(
'.update-notifications'
).
on
'ajax:complete'
,
->
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
'.update-notifications'
).
on
'ajax:complete'
,
->
$
(
this
).
find
(
'.btn-save'
).
enableButton
()
$
(
'.js-choose-user-avatar-button'
).
bind
"click"
,
->
form
=
$
(
this
).
closest
(
"form"
)
form
.
find
(
".js-user-avatar-input"
).
click
()
$
(
'.js-choose-user-avatar-button'
).
bind
"click"
,
->
form
=
$
(
this
).
closest
(
"form"
)
form
.
find
(
".js-user-avatar-input"
).
click
()
$
(
'.js-user-avatar-input'
).
bind
"change"
,
->
form
=
$
(
this
).
closest
(
"form"
)
filename
=
$
(
this
).
val
().
replace
(
/^.*[\\\/]/
,
''
)
form
.
find
(
".js-avatar-filename"
).
text
(
filename
)
$
(
'.profile-groups-avatars'
).
tooltip
(
"placement"
:
"top"
)
$
(
'.js-user-avatar-input'
).
bind
"change"
,
->
form
=
$
(
this
).
closest
(
"form"
)
filename
=
$
(
this
).
val
().
replace
(
/^.*[\\\/]/
,
''
)
form
.
find
(
".js-avatar-filename"
).
text
(
filename
)
app/assets/javascripts/user.js.coffee
0 → 100644
View file @
01441f54
class
@
User
constructor
:
->
$
(
'.profile-groups-avatars'
).
tooltip
(
"placement"
:
"top"
)
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