You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
|
define(['app', 'Shared/NotificationCollection'], function (app, notificationCollection) {
|
|
|
|
|
|
|
|
|
|
var notificationItemView = Backbone.Marionette.ItemView.extend({
|
|
|
|
|
template: 'Shared/NotificationTemplate',
|
|
|
|
|
|
|
|
|
|
events: {
|
|
|
|
|
'click .x-close': 'kill'
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
kill: function () {
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
|
|
|
|
|
$.Deferred(function () {
|
|
|
|
|
self.$el.slideUp('slow');
|
|
|
|
|
}).done(function () {
|
|
|
|
|
self.model.destroy();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var collectionView = Backbone.Marionette.CollectionView.extend({
|
|
|
|
|
|
|
|
|
|
itemView: notificationItemView,
|
|
|
|
|
|
|
|
|
|
initialize: function () {
|
|
|
|
|
this.collection = notificationCollection;
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
NzbDrone.addInitializer(function (options) {
|
|
|
|
|
NzbDrone.notificationRegion.show(new collectionView());
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|