Commit f709339f authored by Eduardo's avatar Eduardo

Apply suggestions from code review

Co-authored-by: 's avatarRobert Knight <robertknight@gmail.com>
parent 2ae809c9
......@@ -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
*
......
......@@ -19,8 +19,8 @@ export default class BucketBar {
* @param {Pick<import('./guest').default, 'anchors'|'scrollToAnchor'|'selectAnnotations'>} guest
*/
constructor(container, guest) {
this._bucketBar = document.createElement('bucket-bar');
container.appendChild(this._bucketBar);
this._bucketsContainer = document.createElement('div');
container.appendChild(this._bucketsContainer);
this._guest = guest;
......@@ -29,8 +29,8 @@ export default class BucketBar {
}
destroy() {
render(null, this._bucketBar);
this._bucketBar.remove();
render(null, this._bucketsContainer);
this._bucketsContainer.remove();
}
update() {
......@@ -45,7 +45,7 @@ export default class BucketBar {
}
scrollToAnchor={anchor => this._guest.scrollToAnchor(anchor)}
/>,
this._bucketBar
this._bucketsContainer
);
}
}
......@@ -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._bucketBar.querySelector('.FakeBuckets'));
assert.ok(bucketBar._bucketsContainer.querySelector('.FakeBuckets'));
});
it('should select annotations when Buckets component invokes callback', () => {
......@@ -82,7 +82,7 @@ describe('BucketBar', () => {
});
describe('#destroy', () => {
it('removes the bucket-bar element', () => {
it('removes the BucketBar container element', () => {
const bucketBar = createBucketBar();
bucketBar.destroy();
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment