1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/UI/Settings/Notifications/CollectionView.js

30 lines
813 B
JavaScript
Raw Normal View History

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