Settings will load with zero notifications

This commit is contained in:
Mark McDowall 2013-07-26 15:07:51 -07:00
parent 07073be73c
commit f25df49068
13 changed files with 69 additions and 83 deletions

View file

@ -3,24 +3,24 @@ define([
'app',
'marionette',
'Settings/Notifications/ItemView',
'Settings/Notifications/SchemaModal'
], function (App, Marionette, NotificationItemView, SchemaModal) {
'Settings/Notifications/SchemaModal',
'Settings/Notifications/AddCardView'
], function (App, Marionette, NotificationItemView, SchemaModal, AddCardView) {
return Marionette.CompositeView.extend({
itemView : NotificationItemView,
itemViewContainer: '.notifications',
template : 'Settings/Notifications/CollectionTemplate',
ui: {
'addCard': '.x-add-card'
},
events: {
'click .x-add-card': '_openSchemaModal'
},
onRender: function () {
this.listenTo(this.collection, 'add', this.render);
this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
appendHtml: function(collectionView, itemView, index){
collectionView.ui.addCard.parent('li').before(itemView.el);
},
_openSchemaModal: function () {