From 98073637d79f01cb26d89e84f73dfad0b6ba46f1 Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Fri, 12 Feb 2021 09:34:09 +0000 Subject: [PATCH] Adjusted CMD+P in editor to open preview modal when post is a draft refs https://github.com/TryGhost/Team/issues/459 - for draft posts we have a new preview modal so the preview shortcut should use that too --- ghost/admin/app/routes/editor.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/ghost/admin/app/routes/editor.js b/ghost/admin/app/routes/editor.js index 7e92313ec2..ac01636d96 100644 --- a/ghost/admin/app/routes/editor.js +++ b/ghost/admin/app/routes/editor.js @@ -56,7 +56,11 @@ export default AuthenticatedRoute.extend(ShortcutsRoute, { }, preview() { - window.open(this.controller.post.previewUrl, '_blank', 'noopener'); + if (this.controller.post.isDraft) { + this.controller.send('togglePostPreviewModal'); + } else { + window.open(this.controller.post.previewUrl, '_blank', 'noopener'); + } }, authorizationFailed() {