Merge pull request #9991 from Snuffleupagus/rm-deprecated-scroll-spread
Remove the deprecated ways, in `BaseViewer`, of setting the Scroll/Spread modes (PR 9858 follow-up)
This commit is contained in:
commit
19e9a2bf34
@ -145,7 +145,6 @@ class BaseViewer {
|
|||||||
this.removePageBorders = options.removePageBorders || false;
|
this.removePageBorders = options.removePageBorders || false;
|
||||||
this.textLayerMode = Number.isInteger(options.textLayerMode) ?
|
this.textLayerMode = Number.isInteger(options.textLayerMode) ?
|
||||||
options.textLayerMode : TextLayerMode.ENABLE;
|
options.textLayerMode : TextLayerMode.ENABLE;
|
||||||
this.enhanceTextSelection = options.enhanceTextSelection || false;
|
|
||||||
this.imageResourcesPath = options.imageResourcesPath || '';
|
this.imageResourcesPath = options.imageResourcesPath || '';
|
||||||
this.renderInteractiveForms = options.renderInteractiveForms || false;
|
this.renderInteractiveForms = options.renderInteractiveForms || false;
|
||||||
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
||||||
@ -171,19 +170,6 @@ class BaseViewer {
|
|||||||
if (this.removePageBorders) {
|
if (this.removePageBorders) {
|
||||||
this.viewer.classList.add('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
|
// Defer the dispatching of this event, to give other viewer components
|
||||||
// time to initialize *and* register 'baseviewerinit' event listeners.
|
// time to initialize *and* register 'baseviewerinit' event listeners.
|
||||||
Promise.resolve().then(() => {
|
Promise.resolve().then(() => {
|
||||||
@ -607,9 +593,7 @@ class BaseViewer {
|
|||||||
let vPadding = noPadding ? 0 : VERTICAL_PADDING;
|
let vPadding = noPadding ? 0 : VERTICAL_PADDING;
|
||||||
|
|
||||||
if (!noPadding && this._isScrollModeHorizontal) {
|
if (!noPadding && this._isScrollModeHorizontal) {
|
||||||
const temp = hPadding;
|
[hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.
|
||||||
hPadding = vPadding;
|
|
||||||
vPadding = temp;
|
|
||||||
}
|
}
|
||||||
let pageWidthScale = (this.container.clientWidth - hPadding) /
|
let pageWidthScale = (this.container.clientWidth - hPadding) /
|
||||||
currentPage.width * currentPage.scale;
|
currentPage.width * currentPage.scale;
|
||||||
@ -1080,14 +1064,6 @@ class BaseViewer {
|
|||||||
this.update();
|
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}.
|
* @return {number} One of the values in {SpreadMode}.
|
||||||
*/
|
*/
|
||||||
@ -1147,14 +1123,6 @@ class BaseViewer {
|
|||||||
this.scrollPageIntoView({ pageNumber, });
|
this.scrollPageIntoView({ pageNumber, });
|
||||||
this.update();
|
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 {
|
export {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user