1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-16 11:37:58 +02:00
Sonarr/NzbDrone.Backbone/Shared/NotificationView.js

41 lines
925 B
JavaScript
Raw Normal View History

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;
2013-02-15 11:18:42 +03:00
}
});
2013-02-15 11:18:42 +03:00
NzbDrone.addInitializer(function () {
2013-02-16 03:49:25 +03:00
console.log('initializing notification view');
NzbDrone.notificationRegion.show(new collectionView());
});
});
2013-02-01 06:15:19 +03:00