|
|
|
@ -746,16 +746,21 @@ var PDFView = {
@@ -746,16 +746,21 @@ var PDFView = {
|
|
|
|
|
return support; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
get loadingBar() { |
|
|
|
|
var bar = new ProgressBar('#loadingBar', {}); |
|
|
|
|
Object.defineProperty(this, 'loadingBar', { value: bar, |
|
|
|
|
enumerable: true, |
|
|
|
|
configurable: true, |
|
|
|
|
writable: false }); |
|
|
|
|
return bar; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
get isHorizontalScrollbarEnabled() { |
|
|
|
|
var div = document.getElementById('viewerContainer'); |
|
|
|
|
return div.scrollWidth > div.clientWidth; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
initPassiveLoading: function pdfViewInitPassiveLoading() { |
|
|
|
|
if (!PDFView.loadingBar) { |
|
|
|
|
PDFView.loadingBar = new ProgressBar('#loadingBar', {}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
var pdfDataRangeTransport = { |
|
|
|
|
rangeListeners: [], |
|
|
|
|
progressListeners: [], |
|
|
|
@ -857,10 +862,6 @@ var PDFView = {
@@ -857,10 +862,6 @@ var PDFView = {
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (!PDFView.loadingBar) { |
|
|
|
|
PDFView.loadingBar = new ProgressBar('#loadingBar', {}); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
this.pdfDocument = null; |
|
|
|
|
var self = this; |
|
|
|
|
self.loading = true; |
|
|
|
@ -1150,8 +1151,7 @@ var PDFView = {
@@ -1150,8 +1151,7 @@ var PDFView = {
|
|
|
|
|
errorWrapper.setAttribute('hidden', 'true'); |
|
|
|
|
|
|
|
|
|
pdfDocument.dataLoaded().then(function() { |
|
|
|
|
var loadingBar = document.getElementById('loadingBar'); |
|
|
|
|
loadingBar.classList.add('hidden'); |
|
|
|
|
PDFView.loadingBar.hide(); |
|
|
|
|
var outerContainer = document.getElementById('outerContainer'); |
|
|
|
|
outerContainer.classList.remove('loadingInProgress'); |
|
|
|
|
}); |
|
|
|
@ -1213,6 +1213,8 @@ var PDFView = {
@@ -1213,6 +1213,8 @@ var PDFView = {
|
|
|
|
|
event.initCustomEvent('documentload', true, true, {}); |
|
|
|
|
window.dispatchEvent(event); |
|
|
|
|
|
|
|
|
|
PDFView.loadingBar.setWidth(container); |
|
|
|
|
|
|
|
|
|
for (var pageNum = 1; pageNum <= pagesCount; ++pageNum) { |
|
|
|
|
var pagePromise = pdfDocument.getPage(pageNum); |
|
|
|
|
pagePromise.then(function(pdfPage) { |
|
|
|
|