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
f6053a1a
Unverified
Commit
f6053a1a
authored
Apr 11, 2019
by
Hannah Stepanek
Committed by
GitHub
Apr 11, 2019
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1062 from hypothesis/make-sidebar-open-on-group-link
Open the sidebar when direct-linked group
parents
af9dedc4
ea3fefe3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
53 additions
and
1 deletion
+53
-1
sidebar.coffee
src/annotator/sidebar.coffee
+1
-1
sidebar-test.coffee
src/annotator/test/sidebar-test.coffee
+52
-0
No files found.
src/annotator/sidebar.coffee
View file @
f6053a1a
...
@@ -34,7 +34,7 @@ module.exports = class Sidebar extends Host
...
@@ -34,7 +34,7 @@ module.exports = class Sidebar extends Host
this
.
hide
()
this
.
hide
()
if
config
.
openSidebar
||
config
.
annotations
||
config
.
query
if
config
.
openSidebar
||
config
.
annotations
||
config
.
query
||
config
.
group
this
.
on
'panelReady'
,
=>
this
.
show
()
this
.
on
'panelReady'
,
=>
this
.
show
()
if
@
plugins
.
BucketBar
?
if
@
plugins
.
BucketBar
?
...
...
src/annotator/test/sidebar-test.coffee
View file @
f6053a1a
...
@@ -233,6 +233,58 @@ describe 'Sidebar', ->
...
@@ -233,6 +233,58 @@ describe 'Sidebar', ->
sidebar
.
onPan
({
type
:
'panright'
,
deltaX
:
100
})
sidebar
.
onPan
({
type
:
'panright'
,
deltaX
:
100
})
assert
.
equal
(
sidebar
.
gestureState
.
final
,
0
)
assert
.
equal
(
sidebar
.
gestureState
.
final
,
0
)
describe
'panelReady event'
,
->
it
'opens the sidebar when a direct-linked annotation is present.'
,
->
sidebar
=
createSidebar
(
config
=
{
annotations
:
'ann-id'
,
}
)
show
=
sandbox
.
stub
(
sidebar
,
'show'
)
sidebar
.
publish
(
'panelReady'
)
assert
.
calledOnce
(
show
)
it
'opens the sidebar when a direct-linked group is present.'
,
->
sidebar
=
createSidebar
(
config
=
{
group
:
'group-id'
,
}
)
show
=
sandbox
.
stub
(
sidebar
,
'show'
)
sidebar
.
publish
(
'panelReady'
)
assert
.
calledOnce
(
show
)
it
'opens the sidebar when a direct-linked query is present.'
,
->
sidebar
=
createSidebar
(
config
=
{
query
:
'tag:foo'
,
}
)
show
=
sandbox
.
stub
(
sidebar
,
'show'
)
sidebar
.
publish
(
'panelReady'
)
assert
.
calledOnce
(
show
)
it
'opens the sidebar when openSidebar is set to true.'
,
->
sidebar
=
createSidebar
(
config
=
{
openSidebar
:
true
,
}
)
show
=
sandbox
.
stub
(
sidebar
,
'show'
)
sidebar
.
publish
(
'panelReady'
)
assert
.
calledOnce
(
show
)
it
'does not show the sidebar if not configured to.'
,
->
sidebar
=
createSidebar
(
config
=
{
}
)
show
=
sandbox
.
stub
(
sidebar
,
'show'
)
sidebar
.
publish
(
'panelReady'
)
assert
.
notCalled
(
show
)
describe
'swipe gestures'
,
->
describe
'swipe gestures'
,
->
sidebar
=
null
sidebar
=
null
...
...
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