2013-05-19 21:19:54 -07:00
|
|
|
'use strict';
|
2013-06-18 18:02:23 -07:00
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'marionette',
|
|
|
|
'Settings/Notifications/ItemView',
|
2013-07-26 16:08:24 -07:00
|
|
|
'Settings/Notifications/SchemaModal'
|
|
|
|
], function (App, Marionette, NotificationItemView, SchemaModal) {
|
2013-06-18 18:02:23 -07:00
|
|
|
return Marionette.CompositeView.extend({
|
|
|
|
itemView : NotificationItemView,
|
2013-06-25 17:34:33 -07:00
|
|
|
itemViewContainer: '.notifications',
|
2013-06-18 18:02:23 -07:00
|
|
|
template : 'Settings/Notifications/CollectionTemplate',
|
2013-05-24 23:38:43 -07:00
|
|
|
|
2013-07-26 15:07:51 -07:00
|
|
|
ui: {
|
|
|
|
'addCard': '.x-add-card'
|
|
|
|
},
|
|
|
|
|
2013-05-24 23:38:43 -07:00
|
|
|
events: {
|
2013-07-25 23:53:37 -07:00
|
|
|
'click .x-add-card': '_openSchemaModal'
|
|
|
|
},
|
|
|
|
|
2013-07-26 15:07:51 -07:00
|
|
|
appendHtml: function(collectionView, itemView, index){
|
|
|
|
collectionView.ui.addCard.parent('li').before(itemView.el);
|
2013-07-26 00:04:25 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
_openSchemaModal: function () {
|
|
|
|
SchemaModal.open(this.collection);
|
2013-05-24 23:38:43 -07:00
|
|
|
}
|
2013-05-19 21:19:54 -07:00
|
|
|
});
|
|
|
|
});
|