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
9c933098
Unverified
Commit
9c933098
authored
Dec 12, 2019
by
Lyza Gardner
Committed by
GitHub
Dec 12, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1592 from hypothesis/annotation-publish-cancel
Update Cancel UI for `AnnotationPublishControl`
parents
eea886ca
aa7f5fae
Changes
3
Show 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 @
9c933098
...
...
@@ -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 @
9c933098
...
...
@@ -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 @
9c933098
@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