Display serverside HTML notifications correctly

refs #4964

- persistent notifcations from the server contain HTML and should be marked HTML safe
This commit is contained in:
Hannah Wolfe 2015-02-28 17:41:38 +00:00
parent a6f0264bf1
commit cecb07f6e2

View File

@ -25,8 +25,19 @@ var Notifications = Ember.ArrayProxy.extend({
this._super(object);
},
handleNotification: function (message, delayed) {
if (!message.status) {
message.status = 'passive';
if (typeof message.toJSON === 'function') {
// If this is a persistent message from the server, treat it as html safe
if (message.get('status') === 'persistent') {
message.set('message', message.get('message').htmlSafe());
}
if (!message.get('status')) {
message.set('status', 'passive');
}
} else {
if (!message.status) {
message.status = 'passive';
}
}
if (!delayed) {