Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
01441f54
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
01441f54
编写于
10月 27, 2014
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8120 from cirosantilli/profile-js-only-needed
Only run profile js on pages that need it
上级
367d4db4
93e8a056
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
29 addition
and
23 deletion
+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
未找到文件。
app/assets/javascripts/dispatcher.js.coffee
浏览文件 @
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
浏览文件 @
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
浏览文件 @
01441f54
class
@
User
constructor
:
->
$
(
'.profile-groups-avatars'
).
tooltip
(
"placement"
:
"top"
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录