Commit 63e2e3af authored by Lyza Danger Gardner's avatar Lyza Danger Gardner Committed by Lyza Gardner

Remove jQuery dependency from BucketBar

Remove jQuery dependency from BucketBar, its tests
and other relevant modules' tests involving BucketBar.

Opportunistically add some type-checking, commenting and
other small improvements but leave general structure as-is.

Increase test coverage.
parent 0b6f8b10
This diff is collapsed.
...@@ -42,7 +42,9 @@ export default class Sidebar extends Host { ...@@ -42,7 +42,9 @@ export default class Sidebar extends Host {
} }
if (this.plugins.BucketBar) { if (this.plugins.BucketBar) {
this.plugins.BucketBar.element.on('click', () => this.show()); this.plugins.BucketBar.element.addEventListener('click', () =>
this.show()
);
} }
// Set up the toolbar on the left edge of the sidebar. // Set up the toolbar on the left edge of the sidebar.
......
import $ from 'jquery';
import PdfSidebar from '../pdf-sidebar'; import PdfSidebar from '../pdf-sidebar';
import { $imports } from '../pdf-sidebar'; import { $imports } from '../pdf-sidebar';
...@@ -46,7 +44,7 @@ describe('PdfSidebar', () => { ...@@ -46,7 +44,7 @@ describe('PdfSidebar', () => {
fakeCrossFrame.destroy = sandbox.stub(); fakeCrossFrame.destroy = sandbox.stub();
const fakeBucketBar = {}; const fakeBucketBar = {};
fakeBucketBar.element = $('<div></div>'); fakeBucketBar.element = document.createElement('div');
fakeBucketBar.destroy = sandbox.stub(); fakeBucketBar.destroy = sandbox.stub();
CrossFrame = sandbox.stub(); CrossFrame = sandbox.stub();
......
import $ from 'jquery';
import events from '../../shared/bridge-events'; import events from '../../shared/bridge-events';
import Sidebar from '../sidebar'; import Sidebar from '../sidebar';
...@@ -68,7 +66,7 @@ describe('Sidebar', () => { ...@@ -68,7 +66,7 @@ describe('Sidebar', () => {
FakeToolbarController = sinon.stub().returns(fakeToolbar); FakeToolbarController = sinon.stub().returns(fakeToolbar);
const fakeBucketBar = {}; const fakeBucketBar = {};
fakeBucketBar.element = $('<div></div>'); fakeBucketBar.element = document.createElement('div');
fakeBucketBar.destroy = sandbox.stub(); fakeBucketBar.destroy = sandbox.stub();
CrossFrame = sandbox.stub(); CrossFrame = sandbox.stub();
......
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