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:
Alice Harris 2014-08-23 02:17:01 +10:00
parent a55738b06f
commit 9dfa30a61f
2 changed files with 541 additions and 1026 deletions

1517
dist/habitrpg-shared.js vendored

File diff suppressed because it is too large Load diff

View file

@ -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}))