Permalink
Browse files

Perform a reset on queryable and viewable collections

Remove condition to ignore models without a `queryview`. This was a
previous behavior that is not longer. Collections passed into the
ConceptIndex are expected to be pre-filtered.
  • Loading branch information...
1 parent f930484 commit 3a0be30973ea5c9e44a5531aafd8a350536115c1 @bruth bruth committed May 9, 2013
Showing with 7 additions and 7 deletions.
  1. +2 −2 coffee/cilantro/models/concept.coffee
  2. +5 −5 coffee/cilantro/ui/concept/index.coffee
@@ -52,8 +52,8 @@ define [
# Update the sub-collections with the specific sets of models
@on 'reset', ->
- @queryable.set @filter (m) -> m.get('queryview')?
- @viewable.set @filter (m) -> m.get('formatter_name')?
+ @queryable.reset @filter (m) -> !!m.get('queryview')
+ @viewable.reset @filter (m) -> !!m.get('formatter_name')
search: (query, handler) ->
c.Backbone.ajax
@@ -68,13 +68,15 @@ define [
class ConceptIndex extends c.Marionette.CollectionView
className: 'accordian'
+
itemView: ConceptAccordianGroup
+
emptyView: empty.EmptyView
# Temporarily override
showCollection: ->
collection = @collection
- @collection = new c.Backbone.Collection @groupModels()
+ @collection = new c.Backbone.Collection @groupModels(collection)
super
@collection = collection
return
@@ -92,13 +94,11 @@ define [
return attrs.category
return id: null, name: 'Other'
- groupModels: ->
+ groupModels: (collection) ->
groups = {}
# Group by category and sub-category
- for model in @collection.models
- if not model.get 'queryview' then continue
-
+ for model in collection.models
attrs = model.attributes
groupAttrs = null
sectionAttrs = null

0 comments on commit 3a0be30

Please sign in to comment.