You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Prowlarr/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js

42 lines
914 B

/// <reference path="../app.js" />
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
return this.get('message').lines().lenght > 1;
},
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": "",
}
});
NzbDrone.Shared.NotificationCollection = Backbone.Collection.extend({
model: NzbDrone.Shared.NotificationModel,
});