From e32c2391a0bfa655355aec117fcc004be64ff9d0 Mon Sep 17 00:00:00 2001 From: Peter Stuifzand Date: Wed, 11 Aug 2021 22:33:04 +0200 Subject: [PATCH] Sort lines based on the text and not the checkboxes --- editor/src/actions.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/editor/src/actions.js b/editor/src/actions.js index 9cca700..3e7f1da 100644 --- a/editor/src/actions.js +++ b/editor/src/actions.js @@ -62,6 +62,10 @@ function sort(id, property, direction) { if (res[1] === 'DONE') return "B"; return "D"; }, direction) + } else if (property === 'text') { + children = _.orderBy(children, item => { + return item.text.replace(/^#\[\[(TODO|DONE)]]\s*/, '') + }, direction) } else { children = _.orderBy(children, property, direction) }