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
809f9ab3
Unverified
Commit
809f9ab3
authored
May 06, 2020
by
Lyza Gardner
Committed by
GitHub
May 06, 2020
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2128 from hypothesis/show-sidebar-label
Change show/hide sidebar button label depending on state
parents
9403c5a1
5471223e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
3 deletions
+6
-3
toolbar-test.js
src/annotator/components/test/toolbar-test.js
+1
-1
toolbar.js
src/annotator/components/toolbar.js
+5
-2
No files found.
src/annotator/components/test/toolbar-test.js
View file @
809f9ab3
...
@@ -66,7 +66,7 @@ describe('Toolbar', () => {
...
@@ -66,7 +66,7 @@ describe('Toolbar', () => {
assert
.
calledWith
(
toggleSidebar
);
assert
.
calledWith
(
toggleSidebar
);
wrapper
.
setProps
({
isSidebarOpen
:
true
});
wrapper
.
setProps
({
isSidebarOpen
:
true
});
findButton
(
wrapper
,
'
Show
annotation sidebar'
).
simulate
(
'click'
);
findButton
(
wrapper
,
'
Hide
annotation sidebar'
).
simulate
(
'click'
);
assert
.
calledWith
(
toggleSidebar
);
assert
.
calledWith
(
toggleSidebar
);
});
});
...
...
src/annotator/components/toolbar.js
View file @
809f9ab3
...
@@ -69,9 +69,12 @@ export default function Toolbar({
...
@@ -69,9 +69,12 @@ export default function Toolbar({
<
ToolbarButton
<
ToolbarButton
extraClasses
=
"annotator-frame-button--sidebar_toggle"
extraClasses
=
"annotator-frame-button--sidebar_toggle"
buttonRef
=
{
toggleSidebarRef
}
buttonRef
=
{
toggleSidebarRef
}
label
=
"Show annotation sidebar"
label
=
{
isSidebarOpen
?
'Hide annotation sidebar'
:
'Show annotation sidebar'
}
icon
=
{
isSidebarOpen
?
'h-icon-chevron-right'
:
'h-icon-chevron-left'
}
icon
=
{
isSidebarOpen
?
'h-icon-chevron-right'
:
'h-icon-chevron-left'
}
selected
=
{
isSidebarOpen
}
onClick
=
{
toggleSidebar
}
onClick
=
{
toggleSidebar
}
/
>
/
>
)}
)}
...
...
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