1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-10-06 08:07:20 +02:00
Radarr/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js
2013-02-15 16:52:58 -08:00

45 lines
938 B
JavaScript

NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
if (this.get('message')) {
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,
});