Only handle scroll events when PDFView.pdfDocument is defined (issue 4642)

This commit is contained in:
Jonas Jenwald 2014-04-19 01:30:40 +02:00
parent a0625ec0e5
commit 4e1362642a

View File

@ -242,6 +242,9 @@ var PDFView = {
state.down = true;
state.lastY = viewAreaElement.scrollTop;
viewAreaElement.addEventListener('scroll', function webViewerScroll(evt) {
if (!PDFView.pdfDocument) {
return;
}
var currentY = viewAreaElement.scrollTop;
var lastY = state.lastY;
if (currentY > lastY) {