mirror of
https://github.com/Sonarr/Sonarr.git
synced 2026-04-18 21:35:27 -04:00
removed backbone from VS solution,
renamed NzbDrone.Backbone to UI
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
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());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user