sonarr-repo-only/NzbDrone.Web/_backboneApp/Shared/NotificationModel.js

44 lines
971 B
JavaScript
Raw Normal View History

/// <reference path="../app.js" />
NzbDrone.Shared.NotificationModel = Backbone.Model.extend({
mutators: {
pre: function () {
2013-02-01 03:15:19 +00:00
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": "",
}
});
2013-01-31 22:40:51 +00:00
NzbDrone.Shared.NotificationCollection = Backbone.Collection.extend({
model: NzbDrone.Shared.NotificationModel,
});