Skip to content

Commit

Permalink
Remove obsolete plugin configuration
Browse files Browse the repository at this point in the history
The empty objects in the default config only exist to ensure that the
corresponding plugin is initialized in the `Guest` constructor.

Some of these are obsolete:

 - There is no longer a `TextSelection` plugin

 - There is no longer a `Toolbar` plugin

 - The `Document` plugin only needs to be initialized in the `Guest`
   base class
  • Loading branch information
robertknight committed Sep 22, 2020
1 parent add1b4e commit 36077d8
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 9 deletions.
4 changes: 1 addition & 3 deletions src/annotator/guest.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,9 @@ const IGNORE_SELECTOR = '[class^="annotator-"],[class^="hypothesis-"]';

export default class Guest extends Delegator {
constructor(element, config, anchoring = htmlAnchoring) {
// TODO - Find out if `defaultConfig` actually does anything and remove it
// if not.
const defaultConfig = {
// This causes the `Document` plugin to be initialized.
Document: {},
TextSelection: {},
};

super(element, { ...defaultConfig, ...config });
Expand Down
4 changes: 0 additions & 4 deletions src/annotator/pdf-sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,11 @@ import Sidebar from './sidebar';
*/

const defaultConfig = {
TextSelection: {},
PDF: {},
BucketBar: {
container: '.annotator-frame',
scrollables: ['#viewerContainer'],
},
Toolbar: {
container: '.annotator-frame',
},
};

// The viewport and controls for PDF.js start breaking down below about 670px
Expand Down
2 changes: 0 additions & 2 deletions src/annotator/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ import { ToolbarController } from './toolbar';
const MIN_RESIZE = 280;

const defaultConfig = {
Document: {},
TextSelection: {},
BucketBar: {
container: '.annotator-frame',
},
Expand Down

0 comments on commit 36077d8

Please sign in to comment.