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
f709339f
Commit
f709339f
authored
Jan 18, 2022
by
Eduardo
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apply suggestions from code review
Co-authored-by:
Robert Knight
<
robertknight@gmail.com
>
parent
2ae809c9
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10 additions
and
9 deletions
+10
-9
bucket-bar-client.js
src/annotator/bucket-bar-client.js
+2
-1
bucket-bar.js
src/annotator/bucket-bar.js
+5
-5
bucket-bar-test.js
src/annotator/test/bucket-bar-test.js
+2
-2
guest-test.js
src/annotator/test/guest-test.js
+1
-1
No files found.
src/annotator/bucket-bar-client.js
View file @
f709339f
...
...
@@ -8,7 +8,8 @@ import { ListenerCollection } from '../shared/listener-collection';
*/
/**
* Communicate to the `host` frame when:
* Communicate to the host frame when:
*
* 1. The set of anchors has been changed (due to annotations being added or removed)
* 2. The position of anchors relative to the viewport of the guest has changed
*
...
...
src/annotator/bucket-bar.js
View file @
f709339f
...
...
@@ -19,8 +19,8 @@ export default class BucketBar {
* @param {Pick<import('./guest').default, 'anchors'|'scrollToAnchor'|'selectAnnotations'>} guest
*/
constructor
(
container
,
guest
)
{
this
.
_bucket
Bar
=
document
.
createElement
(
'bucket-bar
'
);
container
.
appendChild
(
this
.
_bucket
Ba
r
);
this
.
_bucket
sContainer
=
document
.
createElement
(
'div
'
);
container
.
appendChild
(
this
.
_bucket
sContaine
r
);
this
.
_guest
=
guest
;
...
...
@@ -29,8 +29,8 @@ export default class BucketBar {
}
destroy
()
{
render
(
null
,
this
.
_bucket
Ba
r
);
this
.
_bucket
Ba
r
.
remove
();
render
(
null
,
this
.
_bucket
sContaine
r
);
this
.
_bucket
sContaine
r
.
remove
();
}
update
()
{
...
...
@@ -45,7 +45,7 @@ export default class BucketBar {
}
scrollToAnchor
=
{
anchor
=>
this
.
_guest
.
scrollToAnchor
(
anchor
)}
/>
,
this
.
_bucket
Ba
r
this
.
_bucket
sContaine
r
);
}
}
src/annotator/test/bucket-bar-test.js
View file @
f709339f
...
...
@@ -48,7 +48,7 @@ describe('BucketBar', () => {
it
(
'should render buckets for existing anchors when constructed'
,
()
=>
{
const
bucketBar
=
createBucketBar
();
assert
.
calledWith
(
fakeBucketUtil
.
anchorBuckets
,
fakeGuest
.
anchors
);
assert
.
ok
(
bucketBar
.
_bucket
Ba
r
.
querySelector
(
'.FakeBuckets'
));
assert
.
ok
(
bucketBar
.
_bucket
sContaine
r
.
querySelector
(
'.FakeBuckets'
));
});
it
(
'should select annotations when Buckets component invokes callback'
,
()
=>
{
...
...
@@ -82,7 +82,7 @@ describe('BucketBar', () => {
});
describe
(
'#destroy'
,
()
=>
{
it
(
'removes the
bucket-ba
r element'
,
()
=>
{
it
(
'removes the
BucketBar containe
r element'
,
()
=>
{
const
bucketBar
=
createBucketBar
();
bucketBar
.
destroy
();
...
...
src/annotator/test/guest-test.js
View file @
f709339f
...
...
@@ -1295,7 +1295,7 @@ describe('Guest', () => {
});
});
it
(
'does not configure the BucketBarClient if guest is the main annotatable frame'
,
()
=>
{
it
(
'does not configure the BucketBarClient if guest is
not
the main annotatable frame'
,
()
=>
{
createGuest
({
subFrameIdentifier
:
'frame-id'
});
assert
.
notCalled
(
FakeBucketBarClient
);
...
...
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