Ensure that the errorWrapper is closed when a new document is opened (issue 4625)

This commit is contained in:
Jonas Jenwald 2014-04-15 12:00:46 +02:00
parent e874995a0d
commit 12f3d58506

View File

@ -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