1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-28 10:51:48 +00:00
Radarr/NzbDrone.Backbone/Shared/NotificationView.js

41 lines
920 B
JavaScript
Raw Normal View History

define(['app', 'Shared/NotificationCollection'], function (app, notificationCollection) {
var notificationItemView = Backbone.Marionette.ItemView.extend({
2013-02-18 03:04:28 +00:00
template: '#notification-template',
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 08:18:42 +00:00
}
});
2013-02-15 08:18:42 +00:00
NzbDrone.addInitializer(function () {
2013-02-16 00:49:25 +00:00
console.log('initializing notification view');
NzbDrone.notificationRegion.show(new collectionView());
});
});
2013-02-01 03:15:19 +00:00