1
0
mirror of https://github.com/Sonarr/Sonarr.git synced 2024-12-21 01:49:57 +02:00
Sonarr/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js
kay.one c511292abe added more import code in ui.
some jshint cleanup.
2013-02-15 16:52:38 -08:00

43 lines
915 B
JavaScript

/// <reference path="../app.js" />
NzbDrone.Shared.NotificationCollection = Backbone.Collection.extend({
model: NzbDrone.Shared.NotificationModel,
});
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": "",
}
});