mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-23 22:11:09 +03:00
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:
parent
a6f0264bf1
commit
cecb07f6e2
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user