mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-18 23:48:35 +02:00
39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
define(['app'], function () {
|
|
|
|
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
|
|
mutators:{
|
|
pre:function () {
|
|
try {
|
|
if (this.get('message')) {
|
|
return this.get('message').lines().lenght > 1;
|
|
}
|
|
} catch (error) {
|
|
return false;
|
|
}
|
|
|
|
},
|
|
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":''
|
|
}
|
|
});
|
|
}); |