Commit 6e298ea5 authored by Sam Saccone's avatar Sam Saccone

Fix odd class setting in Marionette.

parent 2d8b292f
......@@ -10,6 +10,9 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
Views.ItemView = Marionette.ItemView.extend({
tagName: 'li',
template: '#template-todoItemView',
className: function () {
return this.model.get('completed') ? 'completed' : 'active';
},
ui: {
edit: '.edit',
......@@ -30,16 +33,6 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
change: 'render'
},
onRender: function () {
this.$el.removeClass('active completed');
if (this.model.get('completed')) {
this.$el.addClass('completed');
} else {
this.$el.addClass('active');
}
},
deleteModel: function () {
this.model.destroy();
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment