mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 19:50:37 +00:00
allow tasks to stay visible while being edited, even if the edit changes an attribute that would normally cause the task to be hidden
This commit is contained in:
parent
a55738b06f
commit
9dfa30a61f
2 changed files with 541 additions and 1026 deletions
1517
dist/habitrpg-shared.js
vendored
1517
dist/habitrpg-shared.js
vendored
File diff suppressed because it is too large
Load diff
|
|
@ -245,6 +245,7 @@ api.taskClasses = (task, filters=[], dayStart=0, lastCron=+new Date, showComplet
|
|||
|
||||
# Filters
|
||||
if main # only show when on your own list
|
||||
if !task._editing # always show task being edited (even when tag removed)
|
||||
for filter, enabled of filters
|
||||
if enabled and not task.tags?[filter]
|
||||
# All the other classes don't matter
|
||||
|
|
@ -252,6 +253,11 @@ api.taskClasses = (task, filters=[], dayStart=0, lastCron=+new Date, showComplet
|
|||
|
||||
classes = type
|
||||
|
||||
if task._editing
|
||||
classes += " beingEdited" # Assists filtering by third-party themes.
|
||||
# Example: theme normally hides daily when not scheduled for today,
|
||||
# BUT keeps showing daily when being edited to unschedule it for today
|
||||
|
||||
# show as completed if completed (naturally) or not required for today
|
||||
if type in ['todo', 'daily']
|
||||
if completed or (type is 'daily' and !api.shouldDo(+new Date, task.repeat, {dayStart}))
|
||||
|
|
|
|||
Loading…
Reference in a new issue