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
edd1a8a4
Commit
edd1a8a4
authored
May 07, 2020
by
Lyza Danger Gardner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update annotator toolbar to use SVG icons
parent
524443a4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
toolbar.js
src/annotator/components/toolbar.js
+10
-10
annotator.scss
src/styles/annotator/annotator.scss
+3
-3
No files found.
src/annotator/components/toolbar.js
View file @
edd1a8a4
...
...
@@ -2,6 +2,8 @@ import classnames from 'classnames';
import
propTypes
from
'prop-types'
;
import
{
createElement
}
from
'preact'
;
import
SvgIcon
from
'../../shared/components/svg-icon'
;
function
ToolbarButton
({
buttonRef
,
extraClasses
,
...
...
@@ -19,15 +21,15 @@ function ToolbarButton({
return
(
<
button
// This currently uses the icon font. This needs to be converted to
// `SvgIcon`.
className
=
{
classnames
(
'annotator-frame-button'
,
extraClasses
,
icon
)}
className
=
{
classnames
(
'annotator-frame-button'
,
extraClasses
)}
aria
-
label
=
{
label
}
aria
-
pressed
=
{
selected
}
onClick
=
{
handleClick
}
ref
=
{
buttonRef
}
title
=
{
label
}
/
>
>
<
SvgIcon
name
=
{
icon
}
/
>
<
/button
>
);
}
...
...
@@ -61,7 +63,7 @@ export default function Toolbar({
<
ToolbarButton
extraClasses
=
"annotator-frame-button--sidebar_close"
label
=
"Close annotation sidebar"
icon
=
"
h-icon-close
"
icon
=
"
cancel
"
onClick
=
{
closeSidebar
}
/
>
)}
...
...
@@ -74,14 +76,14 @@ export default function Toolbar({
?
'Hide annotation sidebar'
:
'Show annotation sidebar'
}
icon
=
{
isSidebarOpen
?
'
h-icon-chevron-right'
:
'h-icon-chevron
-left'
}
icon
=
{
isSidebarOpen
?
'
caret-right'
:
'caret
-left'
}
onClick
=
{
toggleSidebar
}
/
>
)}
{
!
useMinimalControls
&&
(
<
ToolbarButton
label
=
"Show highlights"
icon
=
{
showHighlights
?
'
h-icon-visibility'
:
'h-icon-visibility-off
'
}
icon
=
{
showHighlights
?
'
show'
:
'hide
'
}
selected
=
{
showHighlights
}
onClick
=
{
toggleHighlights
}
/
>
...
...
@@ -91,9 +93,7 @@ export default function Toolbar({
label
=
{
newAnnotationType
===
'note'
?
'New page note'
:
'New annotation'
}
icon
=
{
newAnnotationType
===
'note'
?
'h-icon-note'
:
'h-icon-annotate'
}
icon
=
{
newAnnotationType
===
'note'
?
'note'
:
'annotate'
}
onClick
=
{
createAnnotation
}
/
>
)}
...
...
src/styles/annotator/annotator.scss
View file @
edd1a8a4
...
...
@@ -103,12 +103,11 @@ $sidebar-collapse-transition-time: 150ms;
background
:
var
.
$white
;
border
:
solid
1px
var
.
$grey-3
;
border-radius
:
4px
;
color
:
var
.
$grey-
semi
;
color
:
var
.
$grey-
5
;
text-decoration
:
none
;
height
:
30px
;
width
:
30px
;
padding
:
0
;
font-size
:
16px
;
margin-bottom
:
5px
;
&
:active
{
...
...
@@ -117,7 +116,7 @@ $sidebar-collapse-transition-time: 150ms;
&
:focus
,
&
:hover
{
color
:
var
.
$
text-color
;
color
:
var
.
$
grey-7
;
}
}
...
...
@@ -129,6 +128,7 @@ $sidebar-collapse-transition-time: 150ms;
width
:
36px
;
margin-bottom
:
10px
;
height
:
var
.
$top-bar-height
;
color
:
var
.
$grey-semi
;
}
.annotator-frame-button--sidebar_close
{
...
...
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