Commit 466147a1 authored by Paul Miller's avatar Paul Miller

Don't use CSS for filtering in Chaplin-brunch.

parent b4e7bc94
#todoapp.filter-active #todo-list .completed {
display: none; }
#todoapp.filter-completed #todo-list .active {
display: none; }
...@@ -19,8 +19,7 @@ module.exports = class TodoView extends View ...@@ -19,8 +19,7 @@ module.exports = class TodoView extends View
super super
# Reset classes, re-add the appropriate ones. # Reset classes, re-add the appropriate ones.
@$el.removeClass 'active completed' @$el.removeClass 'active completed'
className = if @model.get('completed') then 'completed' else 'active' @$el.toggle @model.get('completed')
@$el.addClass className
destroy: => destroy: =>
@model.destroy() @model.destroy()
......
#todoapp.filter-active #todo-list .completed {
display: none; }
#todoapp.filter-completed #todo-list .active {
display: none; }
/*@ sourceMappingURL=app.css.map*/
\ No newline at end of file
{"version":3,"file":"public/app.css","sources":["app/views/filters.css"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA","sourcesContent":["#todoapp.filter-active #todo-list .completed {\n display: none; }\n\n#todoapp.filter-completed #todo-list .active {\n display: none; }\n"]}
\ No newline at end of file
...@@ -15470,11 +15470,9 @@ module.exports = TodoView = (function(_super) { ...@@ -15470,11 +15470,9 @@ module.exports = TodoView = (function(_super) {
TodoView.prototype.tagName = 'li'; TodoView.prototype.tagName = 'li';
TodoView.prototype.render = function() { TodoView.prototype.render = function() {
var className;
TodoView.__super__.render.apply(this, arguments); TodoView.__super__.render.apply(this, arguments);
this.$el.removeClass('active completed'); this.$el.removeClass('active completed');
className = this.model.get('completed') ? 'completed' : 'active'; return this.$el.toggle(this.model.get('completed'));
return this.$el.addClass(className);
}; };
TodoView.prototype.destroy = function() { TodoView.prototype.destroy = function() {
......
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