Fix bug for ordering checkboxes
This commit is contained in:
parent
27bc12146c
commit
bbbf82ff93
|
@ -56,10 +56,10 @@ function sort(id, property, direction) {
|
|||
let children = this.getChildren(id)
|
||||
if (property === 'todo') {
|
||||
children = _.orderBy(children, item => {
|
||||
let res = item.text.match(/^#\[\[(TODO|DONE)/)
|
||||
const res = item.text.match(/^#\[\[(TODO|DONE)/)
|
||||
if (!res) return "C";
|
||||
if (res[1] === 'TODO') return direction === 'asc' ? "A" : "B";
|
||||
if (res[1] === 'DONE') return direction === 'asc' ? "B" : "A";
|
||||
if (res[1] === 'TODO') return "A";
|
||||
if (res[1] === 'DONE') return "B";
|
||||
return "D";
|
||||
}, direction)
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user