made RootFolderCollection, NotificationCollection singleton.

This commit is contained in:
kay.one
2013-02-14 09:18:29 -08:00
parent 52d815b1d4
commit a2496530ca
27 changed files with 639 additions and 14886 deletions

View File

@@ -1,44 +1,34 @@

define(['app'], function () {
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
if (this.get('message')) {
return this.get('message').lines().lenght > 1;
}
},
iconClass: function () {
mutators: {
pre: function () {
if (this.get('message')) {
return this.get('message').lines().lenght > 1;
if (this.has('icon')) {
return "icon";
}
if (this.get('level') === 'info') {
return "icon-info-sign";
} else if (this.get('level') === 'success') {
return 'icon-ok-sign';
} else if (this.get('level') === 'error') {
return 'icon-warning-sign';
}
return "";
}
},
iconClass: function () {
if (this.has('icon')) {
return "icon";
}
if (this.get('level') === 'info') {
return "icon-info-sign";
}
else if (this.get('level') === 'success') {
return 'icon-ok-sign';
}
else if (this.get('level') === 'error') {
return 'icon-warning-sign';
}
return "";
defaults: {
"level": "info",
"title": "",
"message": "",
}
},
defaults: {
"level": "info",
"title": "",
"message": "",
}
});
NzbDrone.Shared.NotificationCollection = Backbone.Collection.extend({
model: NzbDrone.Shared.NotificationModel,
});
});
});