mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-25 09:18:34 +00:00
769331d45d
single quotes
42 lines
944 B
JavaScript
42 lines
944 B
JavaScript
'use strict';
|
|
|
|
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 () {
|
|
console.log('initializing notification view');
|
|
NzbDrone.notificationRegion.show(new collectionView());
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|