Commit 345a0599 authored by Robert Knight's avatar Robert Knight

Convert PdfSidebar to JS

ES 6 does not provide a direct equivalent for CoffeeScript's static
class properties so the initialization of `options` has been refactored
to use `Object.assign()` as a more idiomatic way to combine the config
args passed to the constructor with the defaults for `PdfSidebar`.
parent 72c87787
Sidebar = require('./sidebar')
module.exports = class PdfSidebar extends Sidebar
options:
TextSelection: {}
PDF: {}
BucketBar:
container: '.annotator-frame'
scrollables: ['#viewerContainer']
Toolbar:
container: '.annotator-frame'
'use strict';
const Sidebar = require('./sidebar');
const DEFAULT_CONFIG = {
TextSelection: {},
PDF: {},
BucketBar: {
container: '.annotator-frame',
scrollables: ['#viewerContainer'],
},
Toolbar: {
container: '.annotator-frame',
},
};
class PdfSidebar extends Sidebar {
constructor(element, config) {
super(element, Object.assign({}, DEFAULT_CONFIG, config));
}
}
module.exports = PdfSidebar;
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