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:
Yury Delendik 2014-04-15 08:38:00 -05:00
commit b4a81cb472

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