2013-05-20 04:19:54 +00:00
|
|
|
|
'use strict';
|
2013-06-19 01:02:23 +00: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-26 00:34:33 +00:00
|
|
|
|
itemViewContainer: '.notifications',
|
2013-06-19 01:02:23 +00:00
|
|
|
|
template : 'Settings/Notifications/CollectionTemplate',
|
2013-05-25 06:38:43 +00:00
|
|
|
|
|
|
|
|
|
events: {
|
2013-06-26 00:34:33 +00:00
|
|
|
|
'click .x-add': '_openSchemaModal'
|
2013-05-26 00:36:12 +00:00
|
|
|
|
},
|
2013-05-25 06:38:43 +00:00
|
|
|
|
|
2013-06-26 00:34:33 +00:00
|
|
|
|
_openSchemaModal: function () {
|
2013-06-19 01:02:23 +00:00
|
|
|
|
var schemaCollection = new NotificationCollection();
|
2013-05-28 15:06:36 +00:00
|
|
|
|
schemaCollection.url = '/api/notification/schema';
|
|
|
|
|
schemaCollection.fetch();
|
2013-05-29 02:49:17 +00:00
|
|
|
|
schemaCollection.url = '/api/notification';
|
2013-05-26 00:36:12 +00:00
|
|
|
|
|
2013-06-19 01:02:23 +00:00
|
|
|
|
var view = new AddSelectionNotificationView({ collection: schemaCollection, notificationCollection: this.collection});
|
|
|
|
|
App.modalRegion.show(view);
|
2013-05-25 06:38:43 +00:00
|
|
|
|
}
|
2013-05-20 04:19:54 +00:00
|
|
|
|
});
|
|
|
|
|
});
|