Stop trying to sort the attachments in the sidebar
Looking at the behaviour in Adobe Reader it doesn't appear that attachments are sorted alphabetically, hence it doesn't seem necessary for us to do so either in the viewer. An additional benefit of *not* sorting the attachments is that any "actual" attachments are now always placed at the top of the list in the sidebar, and if any `FileAttachment`-annotations exist in the document they will now be appended at the end.
This commit is contained in:
parent
65e23432cd
commit
14fd59c4d0
@ -109,13 +109,10 @@ class PDFAttachmentViewer extends BaseTreeViewer {
|
||||
this._dispatchEvent(/* attachmentsCount = */ 0);
|
||||
return;
|
||||
}
|
||||
const names = Object.keys(attachments).sort(function (a, b) {
|
||||
return a.toLowerCase().localeCompare(b.toLowerCase());
|
||||
});
|
||||
|
||||
const fragment = document.createDocumentFragment();
|
||||
let attachmentsCount = 0;
|
||||
for (const name of names) {
|
||||
for (const name in attachments) {
|
||||
const item = attachments[name];
|
||||
const content = item.content,
|
||||
filename = getFilenameFromUrl(
|
||||
|
Loading…
Reference in New Issue
Block a user