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
Tatuya Kamada
gitlab-ce
Commits
46eefbda
Commit
46eefbda
authored
Feb 20, 2017
by
Jose Ivan Vargas
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved the dismiss-icon listener to close the callout to a button
parent
bcab4bb5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
7 deletions
+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
No files found.
app/assets/javascripts/user_callout.js
View file @
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
View file @
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
View file @
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
View file @
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
View file @
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
'
);
});
...
...
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