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) { ...@@ -10,6 +10,9 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
Views.ItemView = Marionette.ItemView.extend({ Views.ItemView = Marionette.ItemView.extend({
tagName: 'li', tagName: 'li',
template: '#template-todoItemView', template: '#template-todoItemView',
className: function () {
return this.model.get('completed') ? 'completed' : 'active';
},
ui: { ui: {
edit: '.edit', edit: '.edit',
...@@ -30,16 +33,6 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) { ...@@ -30,16 +33,6 @@ TodoMVC.module('TodoList.Views', function (Views, App, Backbone, Marionette) {
change: 'render' 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 () { deleteModel: function () {
this.model.destroy(); 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