mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-19 22:58:07 +02:00
Merge pull request #4628 from Snuffleupagus/issue-4625
Ensure that the errorWrapper is closed when a new document is opened (issue 4625)
This commit is contained in:
commit
b4a81cb472
1 changed files with 4 additions and 5 deletions
|
@ -561,6 +561,9 @@ var PDFView = {
|
|||
},
|
||||
|
||||
close: function pdfViewClose() {
|
||||
var errorWrapper = document.getElementById('errorWrapper');
|
||||
errorWrapper.setAttribute('hidden', 'true');
|
||||
|
||||
if (!this.pdfDocument) {
|
||||
return;
|
||||
}
|
||||
|
@ -568,9 +571,6 @@ var PDFView = {
|
|||
this.pdfDocument.destroy();
|
||||
this.pdfDocument = null;
|
||||
|
||||
var errorWrapper = document.getElementById('errorWrapper');
|
||||
errorWrapper.setAttribute('hidden', 'true');
|
||||
|
||||
var thumbsView = document.getElementById('thumbnailView');
|
||||
while (thumbsView.hasChildNodes()) {
|
||||
thumbsView.removeChild(thumbsView.lastChild);
|
||||
|
@ -594,11 +594,10 @@ var PDFView = {
|
|||
open: function pdfViewOpen(url, scale, password,
|
||||
pdfDataRangeTransport, args) {
|
||||
if (this.pdfDocument) {
|
||||
this.close();
|
||||
|
||||
// Reload the preferences if a document was previously opened.
|
||||
Preferences.reload();
|
||||
}
|
||||
this.close();
|
||||
|
||||
var parameters = {password: password};
|
||||
if (typeof url === 'string') { // URL
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue