Skip to content

Commit

Permalink
Remove the deprecated ways, in BaseViewer, of setting the Scroll/Sp…
Browse files Browse the repository at this point in the history
…read modes (PR 9858 follow-up)

Considering that a number of `[api-minor]` changes have landed since PR 9858, removing this code ought to be OK now (the less time these methods remain exposed, the better); implements mozilla#9858 (comment).
  • Loading branch information
Snuffleupagus committed Aug 20, 2018
1 parent 4ea663a commit eef70c1
Showing 1 changed file with 0 additions and 29 deletions.
29 changes: 0 additions & 29 deletions web/base_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,6 @@ class BaseViewer {
if (this.removePageBorders) {
this.viewer.classList.add('removePageBorders');
}

if ((typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) &&
('scrollMode' in options || 'spreadMode' in options)) {
console.error(`The ${this._name} constructor options ` +
'`scrollMode`/`spreadMode` are deprecated, use the setters instead.');
if (options.scrollMode !== undefined) {
this.scrollMode = options.scrollMode;
}
if (options.spreadMode !== undefined) {
this.spreadMode = options.spreadMode;
}
}

// Defer the dispatching of this event, to give other viewer components
// time to initialize *and* register 'baseviewerinit' event listeners.
Promise.resolve().then(() => {
Expand Down Expand Up @@ -1080,14 +1067,6 @@ class BaseViewer {
this.update();
}

setScrollMode(mode) {
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
console.error(`${this._name}.setScrollMode() is deprecated, ` +
`use the ${this._name}.scrollMode setter instead.`);
this.scrollMode = mode;
}
}

/**
* @return {number} One of the values in {SpreadMode}.
*/
Expand Down Expand Up @@ -1147,14 +1126,6 @@ class BaseViewer {
this.scrollPageIntoView({ pageNumber, });
this.update();
}

setSpreadMode(mode) {
if (typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) {
console.error(`${this._name}.setSpreadMode() is deprecated, ` +
`use the ${this._name}.spreadMode setter instead.`);
this.spreadMode = mode;
}
}
}

export {
Expand Down

0 comments on commit eef70c1

Please sign in to comment.