Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
aa7f5fae
Commit
aa7f5fae
authored
Dec 10, 2019
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use SVG icon for cancel; make styling more accessible and consistent
parent
5be86536
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
18 deletions
+8
-18
annotation-publish-control.js
src/sidebar/components/annotation-publish-control.js
+3
-2
annotation-publish-control-test.js
...idebar/components/test/annotation-publish-control-test.js
+3
-1
annotation-publish-control.scss
...styles/sidebar/components/annotation-publish-control.scss
+2
-15
No files found.
src/sidebar/components/annotation-publish-control.js
View file @
aa7f5fae
...
...
@@ -8,6 +8,7 @@ const { withServices } = require('../util/service-context');
const
Menu
=
require
(
'./menu'
);
const
MenuItem
=
require
(
'./menu-item'
);
const
SvgIcon
=
require
(
'./svg-icon'
);
/**
* Render a compound control button for publishing (saving) an annotation:
...
...
@@ -75,11 +76,11 @@ function AnnotationPublishControl({
<
/Menu
>
<
/div
>
<
button
className
=
"a
nnotation-publish-control__cancel-btn btn-clea
n"
className
=
"a
ction-butto
n"
onClick
=
{
onCancel
}
title
=
"Cancel changes to this annotation"
>
<
i
className
=
"h-icon-cancel-outline publish-annotation-cancel-btn__icon btn-icon"
/>
{
' '
}
<
SvgIcon
name
=
"cancel"
className
=
"action-button__icon--compact"
/>
Cancel
<
/button
>
<
/div
>
...
...
src/sidebar/components/test/annotation-publish-control-test.js
View file @
aa7f5fae
...
...
@@ -191,7 +191,9 @@ describe('AnnotationPublishControl', () => {
const
wrapper
=
createAnnotationPublishControl
({
onCancel
:
fakeOnCancel
,
});
const
cancelBtn
=
wrapper
.
find
(
'.annotation-publish-control__cancel-btn'
);
const
cancelBtn
=
wrapper
.
find
(
'[title="Cancel changes to this annotation"]'
);
cancelBtn
.
prop
(
'onClick'
)();
assert
.
calledOnce
(
fakeOnCancel
);
...
...
src/styles/sidebar/components/annotation-publish-control.scss
View file @
aa7f5fae
@use
"../../mixins/buttons"
;
@use
"../../mixins/forms"
;
@use
"../../variables"
as
var
;
.annotation-publish-control
{
display
:
flex
;
&
__cancel-btn
{
margin-left
:
5px
;
font-weight
:
normal
;
color
:
var
.
$grey-4
;
&
:hover
{
color
:
var
.
$grey-5
;
}
&
__icon
{
margin-right
:
3px
;
transform
:
translateY
(
10%
);
}
}
// A split button with a primary submit on the left and a drop-down menu
// of related options to the right
.annotation-publish-control__btn
{
...
...
@@ -32,6 +18,7 @@
height
:
$height
;
position
:
relative
;
margin-right
:
1em
;
// Align the menu arrow correctly with the ▼ in the toggle
&
-menu-arrow
{
...
...
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