1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-05 22:57:29 +02:00

Many improvements and bug fixes

This commit is contained in:
Laurent Cozic
2017-10-18 23:13:53 +01:00
parent 4db08d1a26
commit 1845a0105c
11 changed files with 69 additions and 16 deletions

View File

@@ -98,10 +98,12 @@ class Note extends BaseItem {
if (a[order.by] < b[order.by]) r = +1;
if (a[order.by] > b[order.by]) r = -1;
if (order.dir == 'ASC') r = -r;
if (r) break;
if (r !== 0) break;
}
return r;
// Makes the sort deterministic, so that if, for example, a and b have the
// same updated_time, they aren't swapped every time a list is refreshed.
return a.title.toLowerCase() + a.id < b.title.toLowerCase() + b.id ? -1 : +1;
});
}