1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2025-07-01 00:45:18 +02:00
Files
Sonarr/UI/Settings/Notifications/CollectionView.js

31 lines
921 B
JavaScript
Raw Normal View History

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-06-27 18:55:45 -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
events: {
2013-07-25 23:53:37 -07:00
'click .x-add-card': '_openSchemaModal'
},
onRender: function () {
this.listenTo(this.collection, 'add', this.render);
2013-07-25 23:53:37 -07:00
this.templateFunction = Marionette.TemplateCache.get('Settings/Notifications/AddCardTemplate');
var html = this.templateFunction();
this.$itemViewContainer.append(html);
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
});
});