mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 16:43:58 -07:00
removed backbone from VS solution,
renamed NzbDrone.Backbone to UI
This commit is contained in:
parent
c7776f74e1
commit
663160c06a
230 changed files with 57 additions and 386 deletions
40
UI/Shared/NotificationView.js
Normal file
40
UI/Shared/NotificationView.js
Normal file
|
@ -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());
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue