2013-05-19 21:19:54 -07:00
|
|
|
'use strict';
|
2013-06-18 18:02:23 -07:00
|
|
|
define([
|
|
|
|
'app',
|
|
|
|
'marionette',
|
|
|
|
'Settings/Notifications/Collection',
|
|
|
|
'Settings/Notifications/ItemView',
|
|
|
|
'Settings/Notifications/AddView'
|
|
|
|
], function (App, Marionette, NotificationCollection, NotificationItemView, AddSelectionNotificationView) {
|
|
|
|
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
|
|
|
|
|
|
|
events: {
|
2013-06-25 17:34:33 -07:00
|
|
|
'click .x-add': '_openSchemaModal'
|
2013-05-25 17:36:12 -07:00
|
|
|
},
|
2013-05-24 23:38:43 -07:00
|
|
|
|
2013-06-25 17:34:33 -07:00
|
|
|
_openSchemaModal: function () {
|
2013-06-18 18:02:23 -07:00
|
|
|
var schemaCollection = new NotificationCollection();
|
2013-05-28 08:06:36 -07:00
|
|
|
schemaCollection.url = '/api/notification/schema';
|
|
|
|
schemaCollection.fetch();
|
2013-05-28 19:49:17 -07:00
|
|
|
schemaCollection.url = '/api/notification';
|
2013-05-25 17:36:12 -07:00
|
|
|
|
2013-06-18 18:02:23 -07:00
|
|
|
var view = new AddSelectionNotificationView({ collection: schemaCollection, notificationCollection: this.collection});
|
|
|
|
App.modalRegion.show(view);
|
2013-05-24 23:38:43 -07:00
|
|
|
}
|
2013-05-19 21:19:54 -07:00
|
|
|
});
|
|
|
|
});
|