Skip to content

Commit

Permalink
All: Fixes #1732: Fixed note order when dragging a note outside a not…
Browse files Browse the repository at this point in the history
…ebook
  • Loading branch information
laurent22 committed Jul 21, 2019
1 parent 35b6b3f commit 6a42ef5
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions ReactNativeClient/lib/models/Note.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,12 @@ class Note extends BaseItem {

for (let i = 0; i < orders.length; i++) {
const order = orders[i];
if (a[order.by] < b[order.by]) r = +1;
if (a[order.by] > b[order.by]) r = -1;
let aProp = a[order.by];
let bProp = b[order.by];
if (typeof aProp === 'string') aProp = aProp.toLowerCase();
if (typeof bProp === 'string') bProp = bProp.toLowerCase();
if (aProp < bProp) r = +1;
if (aProp > bProp) r = -1;
if (order.dir == 'ASC') r = -r;
if (r !== 0) return r;
}
Expand Down

0 comments on commit 6a42ef5

Please sign in to comment.