'navigator/filters/base-filters',
'navigator/filters/favorite-filters',
'navigator/filters/more-criteria-filters',
+ 'navigator/filters/read-only-filters',
'templates/coding-rules'
], (
FilterBarView,
BaseFilters,
FavoriteFiltersModule,
MoreCriteriaFilters,
+ ReadOnlyFilterView,
Templates
) ->
addMoreCriteriaFilter: ->
- disabledFilters = this.collection.where enabled: false
+ readOnlyFilters = @collection.where(type: ReadOnlyFilterView)
+ console.log readOnlyFilters
+ disabledFilters = _.difference(@collection.where(enabled: false), readOnlyFilters)
+ console.log disabledFilters
if disabledFilters.length > 0
@moreCriteriaFilter = new BaseFilters.Filter
type: MoreCriteriaFilters.MoreCriteriaFilterView,
changeEnabled: ->
if @moreCriteriaFilter?
disabledFilters = _.reject @collection.where(enabled: false), (filter) ->
- filter.get('type') == MoreCriteriaFilters.MoreCriteriaFilterView
+ filter.get('type') in [MoreCriteriaFilters.MoreCriteriaFilterView, ReadOnlyFilterView]
if disabledFilters.length == 0
@moreCriteriaFilter.set { enabled: false }, { silent: true }