Refactor PDFAttachmentView to be more class-like and to separate functionality into methods

This commit is contained in:
Tim van der Meij 2015-01-27 22:06:19 +01:00
parent 609e2a30e9
commit 733882ac25
2 changed files with 52 additions and 34 deletions

View file

@ -985,14 +985,15 @@ var PDFViewerApplication = {
}
});
pdfDocument.getAttachments().then(function(attachments) {
var attachmentsView = document.getElementById('attachmentsView');
var container = document.getElementById('attachmentsView');
self.attachments = new PDFAttachmentView({
attachments: attachments,
attachmentsView: attachmentsView
container: container,
attachments: attachments
});
self.attachments.render();
document.getElementById('viewAttachments').disabled = !attachments;
if (!attachments && !attachmentsView.classList.contains('hidden')) {
if (!attachments && !container.classList.contains('hidden')) {
self.switchSidebarView('thumbs');
}
if (attachments &&