Commit 62557943 authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Removed references to 'plugin.BucketBar'

BucketBar is not used anymore as a plugin.
parent 4677e16f
......@@ -152,6 +152,9 @@ export default class Guest extends Delegator {
this.plugins = {};
/** @typedef {import('./bucket-bar').default|null} */
this.bucketBar = null;
/** @type {Anchor[]} */
this.anchors = [];
......@@ -483,7 +486,7 @@ export default class Guest extends Delegator {
this.anchors = this.anchors.concat(anchors);
// Let plugins know about the new information.
this.plugins.BucketBar?.update();
this.bucketBar?.update();
this.plugins.CrossFrame?.sync([annotation]);
return anchors;
......@@ -543,7 +546,7 @@ export default class Guest extends Delegator {
this.anchors = anchors;
removeHighlights(unhighlight);
this.plugins.BucketBar?.update();
this.bucketBar?.update();
}
/**
......
......@@ -78,7 +78,7 @@ export default class Sidebar extends Guest {
if (config.theme === 'clean') {
frame.classList.add('annotator-frame--theme-clean');
} else {
this.plugins.BucketBar = new BucketBar(frame, this, config.BucketBar);
this.bucketbar = new BucketBar(frame, this, config.BucketBar);
}
// Undocumented switch to enable/disable the wrapping of the sidebar inside a shadow DOM
......
......@@ -770,10 +770,10 @@ describe('Guest', () => {
it('updates the cross frame and bucket bar plugins', () => {
const guest = createGuest();
guest.plugins.CrossFrame = { sync: sinon.stub() };
guest.plugins.BucketBar = { update: sinon.stub() };
guest.bucketBar = { update: sinon.stub() };
const annotation = {};
return guest.anchor(annotation).then(() => {
assert.called(guest.plugins.BucketBar.update);
assert.called(guest.bucketBar.update);
assert.called(guest.plugins.CrossFrame.sync);
});
});
......@@ -852,13 +852,13 @@ describe('Guest', () => {
it('updates the bucket bar plugin', () => {
const guest = createGuest();
guest.plugins.BucketBar = { update: sinon.stub() };
guest.bucketBar = { update: sinon.stub() };
const annotation = {};
guest.anchors.push({ annotation });
guest.detach(annotation);
assert.calledOnce(guest.plugins.BucketBar.update);
assert.calledOnce(guest.bucketBar.update);
});
it('removes any highlights associated with the annotation', () => {
......
......@@ -81,15 +81,13 @@ describe('Sidebar', () => {
const fakeBucketBar = {};
fakeBucketBar.element = document.createElement('div');
fakeBucketBar.destroy = sandbox.stub();
const BucketBar = sandbox.stub();
BucketBar.returns(fakeBucketBar);
CrossFrame = sandbox.stub();
CrossFrame.returns(fakeCrossFrame);
const BucketBar = sandbox.stub();
BucketBar.returns(fakeBucketBar);
sidebarConfig.pluginClasses.CrossFrame = CrossFrame;
sidebarConfig.pluginClasses.BucketBar = BucketBar;
sidebars = [];
......@@ -97,6 +95,7 @@ describe('Sidebar', () => {
'./toolbar': {
ToolbarController: FakeToolbarController,
},
'./bucket-bar': { default: BucketBar },
});
});
......@@ -788,16 +787,16 @@ describe('Sidebar', () => {
});
describe('config', () => {
it('does not have the BucketBar plugin if the clean theme is enabled', () => {
it('does not have the BucketBar if the clean theme is enabled', () => {
const sidebar = createSidebar({ theme: 'clean' });
assert.isUndefined(sidebar.plugins.BucketBar);
assert.isNull(sidebar.bucketBar);
});
it('does not have the BucketBar if an external container is provided', () => {
const sidebar = createSidebar({
externalContainerSelector: `.${EXTERNAL_CONTAINER_SELECTOR}`,
});
assert.isUndefined(sidebar.plugins.BucketBar);
assert.isNull(sidebar.bucketBar);
});
it('disables shadow DOM if `disableShadowSidebar` flag is set', () => {
......
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