mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-09 17:55:37 +02:00
Only handle scroll events when PDFView.pdfDocument is defined (issue 4642)
This commit is contained in:
parent
a0625ec0e5
commit
4e1362642a
1 changed files with 3 additions and 0 deletions
|
@ -242,6 +242,9 @@ var PDFView = {
|
||||||
state.down = true;
|
state.down = true;
|
||||||
state.lastY = viewAreaElement.scrollTop;
|
state.lastY = viewAreaElement.scrollTop;
|
||||||
viewAreaElement.addEventListener('scroll', function webViewerScroll(evt) {
|
viewAreaElement.addEventListener('scroll', function webViewerScroll(evt) {
|
||||||
|
if (!PDFView.pdfDocument) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
var currentY = viewAreaElement.scrollTop;
|
var currentY = viewAreaElement.scrollTop;
|
||||||
var lastY = state.lastY;
|
var lastY = state.lastY;
|
||||||
if (currentY > lastY) {
|
if (currentY > lastY) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue