Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
46eefbda
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,发现更多精彩内容 >>
提交
46eefbda
编写于
2月 20, 2017
作者:
J
Jose Ivan Vargas
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Moved the dismiss-icon listener to close the callout to a button
上级
bcab4bb5
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
7 addition
and
7 deletion
+7
-7
app/assets/javascripts/user_callout.js
app/assets/javascripts/user_callout.js
+2
-2
app/views/shared/_user_callout.html.haml
app/views/shared/_user_callout.html.haml
+1
-1
spec/features/user_callout_spec.rb
spec/features/user_callout_spec.rb
+1
-1
spec/javascripts/fixtures/user_callout.html.haml
spec/javascripts/fixtures/user_callout.html.haml
+1
-1
spec/javascripts/user_callout_spec.js
spec/javascripts/user_callout_spec.js
+2
-2
未找到文件。
app/assets/javascripts/user_callout.js
浏览文件 @
46eefbda
...
...
@@ -2,7 +2,7 @@
/* global Cookies */
const
userCalloutElementName
=
'
.user-callout
'
;
const
dismissIcon
=
'
.dismiss-icon
'
;
const
closeButton
=
'
.close-user-callout
'
;
const
userCalloutBtn
=
'
.user-callout-btn
'
;
const
USER_CALLOUT_COOKIE
=
'
user_callout_dismissed
'
;
...
...
@@ -16,7 +16,7 @@ class UserCallout {
init
()
{
$
(
document
)
.
on
(
'
click
'
,
dismissIc
on
,
()
=>
this
.
closeAndDismissCallout
())
.
on
(
'
click
'
,
closeButt
on
,
()
=>
this
.
closeAndDismissCallout
())
.
on
(
'
click
'
,
userCalloutBtn
,
()
=>
this
.
closeAndDismissCallout
());
}
...
...
app/views/shared/_user_callout.html.haml
浏览文件 @
46eefbda
.user-callout
.bordered-box.landing.content-block
%button
.btn.btn-default.close
{
type:
"button"
}
%button
.btn.btn-default.close
.close-user-callout
{
type:
"button"
}
=
icon
(
"times"
,
class:
"dismiss-icon"
)
.row
.col-sm-3.col-xs-12.svg-container
...
...
spec/features/user_callout_spec.rb
浏览文件 @
46eefbda
...
...
@@ -30,7 +30,7 @@ describe 'User Callouts', js: true do
it
'hides the user callout when click on the dismiss icon'
do
visit
user_path
(
user
)
within
(
'.user-callout'
)
do
find
(
'.
dismiss-icon
'
).
click
find
(
'.
close-user-callout
'
).
click
end
expect
(
page
).
not_to
have_selector
(
'#user-callout'
)
end
...
...
spec/javascripts/fixtures/user_callout.html.haml
浏览文件 @
46eefbda
.user-callout
.bordered-box.landing.content-block
%button
.btn.btn-default.close
{
type:
"button"
}
%button
.btn.btn-default.close
.close-user-callout
{
type:
"button"
}
%i
.fa.fa-times.dismiss-icon
.row
.col-sm-3.col-xs-12.svg-container
...
...
spec/javascripts/user_callout_spec.js
浏览文件 @
46eefbda
...
...
@@ -11,7 +11,7 @@ describe('UserCallout', function () {
beforeEach
(()
=>
{
loadFixtures
(
fixtureName
);
this
.
userCallout
=
new
UserCallout
();
this
.
dismissIcon
=
$
(
'
.dismiss-icon
'
);
this
.
closeButton
=
$
(
'
.close-user-callout
'
);
this
.
userCalloutContainer
=
$
(
'
.user-callout
'
);
this
.
userCalloutBtn
=
$
(
'
.user-callout-btn
'
);
Cookie
.
set
(
USER_CALLOUT_COOKIE
,
0
);
...
...
@@ -23,7 +23,7 @@ describe('UserCallout', function () {
});
it
(
'
hides when user clicks on the dismiss-icon
'
,
()
=>
{
this
.
dismissIc
on
.
click
();
this
.
closeButt
on
.
click
();
expect
(
this
.
userCalloutContainer
.
is
(
'
:visible
'
)).
toBe
(
false
);
expect
(
Cookie
.
get
(
USER_CALLOUT_COOKIE
)).
toBe
(
'
1
'
);
});
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录