mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-16 16:04:08 +01:00
34 lines
928 B
JavaScript
34 lines
928 B
JavaScript
define(['app'], function () {
|
|
|
|
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": "",
|
|
}
|
|
});
|
|
}); |