3 var Marionette = require('backbone.marionette');
4 var classnames = require('classnames');
5 var PermissionsPeopleListItemTemplate = require('./tmpl/modal-footer-button-list-view-item.hbs');
7 var FooterButtonListItemView = Marionette.ItemView.extend({
8 template: PermissionsPeopleListItemTemplate,
10 attributes: function() {
11 var action = this.model.get('action');
14 'data-action': action,
15 'data-component': 'modal-btn'
18 var disabled = this.model.get('disabled');
20 attributes['disabled'] = disabled;
23 var className = this.model.get('className');
24 var pull = this.model.get('pull');
27 classMap[className] = true;
28 classMap['pull-' + pull] = !!pull;
30 attributes['class'] = classnames(classMap);
36 click: 'item:activate'
40 var FooterButtonListView = Marionette.CollectionView.extend({
42 childView: FooterButtonListItemView,
43 className: 'modal--default__footer',
46 'item:activate': 'onItemActivated'
49 initialize: function(options) {
50 this.communityCreateModel = options.communityCreateModel;
53 onItemActivated: function(view) {
54 this.trigger('item:activate', view.model);
58 module.exports = FooterButtonListView;