mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-26 01:37:07 +00:00
663160c06a
renamed NzbDrone.Backbone to UI
40 lines
920 B
JavaScript
40 lines
920 B
JavaScript
define(['app', 'Shared/NotificationCollection'], function (app, notificationCollection) {
|
|
|
|
var notificationItemView = Backbone.Marionette.ItemView.extend({
|
|
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;
|
|
}
|
|
});
|
|
|
|
NzbDrone.addInitializer(function () {
|
|
console.log('initializing notification view');
|
|
NzbDrone.notificationRegion.show(new collectionView());
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|