mirror of
https://github.com/lidarr/Lidarr
synced 2024-12-29 11:05:44 +00:00
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());
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|