2019-09-22 21:02:31 +00:00
|
|
|
var _ = require('underscore')
|
|
|
|
var Marionette = require('marionette')
|
2014-05-07 00:11:12 +00:00
|
|
|
|
2019-09-22 21:02:31 +00:00
|
|
|
var ListItemView = require('app/views/missions/list_item')
|
|
|
|
var tpl = require('tpl/missions/list.html')
|
2014-05-07 00:11:12 +00:00
|
|
|
|
2019-09-22 21:02:31 +00:00
|
|
|
var template = _.template(tpl)
|
2014-05-07 00:11:12 +00:00
|
|
|
|
2019-09-22 21:02:31 +00:00
|
|
|
module.exports = Marionette.CompositeView.extend({
|
|
|
|
childView: ListItemView,
|
|
|
|
childViewContainer: 'tbody',
|
|
|
|
template: template,
|
2014-05-07 00:11:12 +00:00
|
|
|
|
2019-09-22 21:02:31 +00:00
|
|
|
initialize: function (options) {
|
|
|
|
this.filterValue = options.filterValue
|
|
|
|
},
|
2019-06-23 18:32:04 +00:00
|
|
|
|
2019-09-22 21:02:31 +00:00
|
|
|
filter: function (child, index, collection) {
|
|
|
|
return child.get('name').toLowerCase().indexOf(this.filterValue.toLowerCase()) >= 0
|
|
|
|
}
|
|
|
|
})
|