From c3493945635f878d40c9a5e398ad6118d6244874 Mon Sep 17 00:00:00 2001 From: Matt Enlow Date: Tue, 12 Jan 2016 13:29:57 -0700 Subject: [PATCH] Add Preview link to draft saved notification Closes #6330 - also change notifications to open with `target=_blank` --- core/client/app/mixins/editor-base-controller.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/core/client/app/mixins/editor-base-controller.js b/core/client/app/mixins/editor-base-controller.js index e95a0acd6e..2eb153ba53 100644 --- a/core/client/app/mixins/editor-base-controller.js +++ b/core/client/app/mixins/editor-base-controller.js @@ -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 += ` View ${type}`; + type = this.get('postOrPage'); + path = this.get('model.absoluteUrl'); + } else { + type = 'Preview'; + path = this.get('model.previewUrl'); } + message += ` View ${type}`; + notifications.showNotification(message.htmlSafe(), {delayed: delay}); },