Merge pull request #11129 from Snuffleupagus/animationStarted-setInitialView

Prevent "offsetParent is not set -- cannot scroll" errors when the viewer loads in e.g. a hidden <iframe>
This commit is contained in:
Tim van der Meij 2019-09-09 22:38:54 +02:00 committed by GitHub
commit 4fa60f006b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -939,8 +939,13 @@ let PDFViewerApplication = {
}).catch(() => { /* Unable to read from storage; ignoring errors. */ }); }).catch(() => { /* Unable to read from storage; ignoring errors. */ });
Promise.all([ Promise.all([
storePromise, pageLayoutPromise, pageModePromise, openActionDestPromise, animationStarted,
]).then(async ([values = {}, pageLayout, pageMode, openActionDest]) => { storePromise,
pageLayoutPromise,
pageModePromise,
openActionDestPromise,
]).then(async ([timeStamp, values = {}, pageLayout, pageMode,
openActionDest]) => {
const viewOnLoad = AppOptions.get('viewOnLoad'); const viewOnLoad = AppOptions.get('viewOnLoad');
this._initializePdfHistory({ this._initializePdfHistory({
@ -1088,7 +1093,7 @@ let PDFViewerApplication = {
}); });
}); });
Promise.all([onePageRendered, animationStarted]).then(() => { onePageRendered.then(() => {
pdfDocument.getOutline().then((outline) => { pdfDocument.getOutline().then((outline) => {
this.pdfOutlineViewer.render({ outline, }); this.pdfOutlineViewer.render({ outline, });
}); });