mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-04-14 19:47:03 +00:00
Small bug fixes calling reset
This commit is contained in:
parent
8c494a189a
commit
952cc206c5
2 changed files with 3 additions and 5 deletions
|
|
@ -2,7 +2,7 @@ HabitTracker.Views.Habits ||= {}
|
|||
|
||||
class HabitTracker.Views.Habits.HabitView extends Backbone.View
|
||||
template: JST["backbone/templates/habits/habit"]
|
||||
|
||||
|
||||
events:
|
||||
"click .destroy" : "destroy"
|
||||
"click .vote-up" : "voteUp"
|
||||
|
|
@ -15,7 +15,6 @@ class HabitTracker.Views.Habits.HabitView extends Backbone.View
|
|||
|
||||
voteUp: ->
|
||||
@model.vote("up")
|
||||
@trigger("reset")
|
||||
|
||||
voteDown: ->
|
||||
@model.vote("down")
|
||||
|
|
|
|||
|
|
@ -5,8 +5,7 @@ class HabitTracker.Views.Habits.IndexView extends Backbone.View
|
|||
|
||||
initialize: () ->
|
||||
@options.habits.bind('reset', @addAll)
|
||||
#TODO this is causing "Remaining" tab to be auto-selected
|
||||
@options.habits.bind('change', @render, this)
|
||||
@options.habits.bind('change', @render, this) #TODO this ruins tabs, revisit
|
||||
|
||||
addAll: () =>
|
||||
@options.habits.each(@addOne)
|
||||
|
|
@ -17,7 +16,7 @@ class HabitTracker.Views.Habits.IndexView extends Backbone.View
|
|||
if habit.isDaily() then @$("#habits-daily").append(view.render().el)
|
||||
if habit.isDoneTodo() then @$("#habits-todos-done").append(view.render().el)
|
||||
if habit.isRemainingTodo() then @$("#habits-todos-remaining").append(view.render().el)
|
||||
|
||||
|
||||
render: =>
|
||||
$(@el).html(@template(habits: @options.habits.toJSON() ))
|
||||
@addAll()
|
||||
|
|
|
|||
Loading…
Reference in a new issue