parent
892c1169c8
commit
ad36c9fb2a
1 changed files with 15 additions and 5 deletions
|
@ -538,11 +538,21 @@ var ZoteroContextPane = new function () {
|
||||||
}
|
}
|
||||||
notes = await s.search();
|
notes = await s.search();
|
||||||
notes = Zotero.Items.get(notes);
|
notes = Zotero.Items.get(notes);
|
||||||
notes.sort((a, b) => {
|
if (Zotero.Prefs.get('sortNotesChronologically')) {
|
||||||
a = a.dateModified;
|
notes.sort((a, b) => {
|
||||||
b = b.dateModified;
|
a = a.dateModified;
|
||||||
return (a > b ? -1 : (a < b ? 1 : 0));
|
b = b.dateModified;
|
||||||
});
|
return (a > b ? -1 : (a < b ? 1 : 0));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let collation = Zotero.getLocaleCollation();
|
||||||
|
notes.sort((a, b) => {
|
||||||
|
let aTitle = Zotero.Items.getSortTitle(a.getField('title'));
|
||||||
|
let bTitle = Zotero.Items.getSortTitle(b.getField('title'));
|
||||||
|
return collation.compareString(1, aTitle, bTitle);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
let cachedNotesIndex = new Map();
|
let cachedNotesIndex = new Map();
|
||||||
for (let cachedNote of context.cachedNotes) {
|
for (let cachedNote of context.cachedNotes) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue