mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-07-18 17:54:10 +00:00
Add clear-completed button
This commit is contained in:
parent
8c50969899
commit
994efb5f79
2 changed files with 6 additions and 7 deletions
|
|
@ -182,13 +182,6 @@ ready (model) ->
|
|||
placement: step.placement
|
||||
tour.start()
|
||||
|
||||
#TODO: implement this for completed tab
|
||||
# clearCompleted: ->
|
||||
# _.each @options.habits.doneTodos(), (todo) ->
|
||||
# todo.destroy()
|
||||
# @render()
|
||||
# return false
|
||||
|
||||
model.on 'set', '_user.tasks.*.completed', (i, completed, previous, isLocal, passed) ->
|
||||
return if passed.cron? # Don't do this stuff on cron
|
||||
direction = () ->
|
||||
|
|
@ -243,6 +236,11 @@ ready (model) ->
|
|||
model.del('_user.tasks.'+task.get('id'))
|
||||
task.remove()
|
||||
|
||||
exports.clearCompleted = (e, el) ->
|
||||
_.each model.get('_completedList'), (task) ->
|
||||
model.del('_user.tasks.'+task.id)
|
||||
model.set('_user.completedIds', [])
|
||||
|
||||
exports.toggleTaskEdit = (e, el) ->
|
||||
hideId = $(el).attr('data-hide-id')
|
||||
toggleId = $(el).attr('data-toggle-id')
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@
|
|||
<ul class='completeds'>
|
||||
{#each _completedList as :task}<app:task />{/}
|
||||
</ul>
|
||||
<a x-bind=click:clearCompleted>Clear Completed</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue