1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-19 16:01:46 +02:00
Radarr/UI/Shared/NotificationView.js
2013-03-29 16:28:58 -07:00

43 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());
});
});