1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-11-06 02:52:41 +01:00
Radarr/UI/Shared/NotificationView.js

43 lines
944 B
JavaScript
Raw Normal View History

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