Sonarr/NzbDrone.Web/_backboneApp/Shared/NotificationView.js

40 lines
878 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;
},
});
NzbDrone.addInitializer(function (options) {
NzbDrone.notificationRegion.show(new collectionView());
});
});
2013-02-01 03:15:19 +00:00