mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-18 07:51:55 +03:00
Add Preview link to draft saved notification
Closes #6330 - also change notifications to open with `target=_blank`
This commit is contained in:
parent
29652eb6a4
commit
e210e4de2a
@ -212,14 +212,19 @@ export default Mixin.create({
|
|||||||
// TODO: Update for new notification click-action API
|
// TODO: Update for new notification click-action API
|
||||||
showSaveNotification(prevStatus, status, delay) {
|
showSaveNotification(prevStatus, status, delay) {
|
||||||
let message = this.messageMap.success.post[prevStatus][status];
|
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 notifications = this.get('notifications');
|
||||||
|
let type, path;
|
||||||
|
|
||||||
if (status === 'published') {
|
if (status === 'published') {
|
||||||
message += ` <a href="${path}">View ${type}</a>`;
|
type = this.get('postOrPage');
|
||||||
|
path = this.get('model.absoluteUrl');
|
||||||
|
} else {
|
||||||
|
type = 'Preview';
|
||||||
|
path = this.get('model.previewUrl');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message += ` <a href="${path}" target="_blank">View ${type}</a>`;
|
||||||
|
|
||||||
notifications.showNotification(message.htmlSafe(), {delayed: delay});
|
notifications.showNotification(message.htmlSafe(), {delayed: delay});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user