1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-11-01 00:12:30 +01:00
Sonarr/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());
});
});