0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Add Preview link to draft saved notification

Closes #6330
- also change notifications to open with `target=_blank`
This commit is contained in:
Matt Enlow 2016-01-12 13:29:57 -07:00
parent 248c3da667
commit c349394563

View file

@ -212,14 +212,19 @@ export default Mixin.create({
// TODO: Update for new notification click-action API
showSaveNotification(prevStatus, status, delay) {
let message = this.messageMap.success.post[prevStatus][status];
let path = this.get('model.absoluteUrl');
let type = this.get('postOrPage');
let notifications = this.get('notifications');
let type, path;
if (status === 'published') {
message += `&nbsp;<a href="${path}">View ${type}</a>`;
type = this.get('postOrPage');
path = this.get('model.absoluteUrl');
} else {
type = 'Preview';
path = this.get('model.previewUrl');
}
message += `&nbsp;<a href="${path}" target="_blank">View ${type}</a>`;
notifications.showNotification(message.htmlSafe(), {delayed: delay});
},