Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove handling of fallback arguments from PDFViewer.scrollPageIntoView #8807

Merged
merged 1 commit into from
Aug 22, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions web/pdf_viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,20 +581,13 @@ class PDFViewer {
* @param {ScrollPageIntoViewParameters} params
*/
scrollPageIntoView(params) {
if (!this.pdfDocument) {
return;
}
if ((typeof PDFJSDev === 'undefined' || PDFJSDev.test('GENERIC')) &&
(arguments.length > 1 || typeof params === 'number')) {
console.warn('Call of scrollPageIntoView() with obsolete signature.');
let paramObj = {};
if (typeof params === 'number') {
paramObj.pageNumber = params; // pageNumber argument was found.
}
if (arguments[1] instanceof Array) {
paramObj.destArray = arguments[1]; // destArray argument was found.
}
params = paramObj;
console.error('Call of scrollPageIntoView() with obsolete signature.');
return;
}
if (!this.pdfDocument) {
return;
}
let pageNumber = params.pageNumber || 0;
let dest = params.destArray || null;
Expand Down