From 802a3c61879b78cd4fd7cb1c5d4bdac2dfd5be0c Mon Sep 17 00:00:00 2001 From: Kevin Ansfield Date: Thu, 19 May 2022 13:33:23 +0100 Subject: [PATCH] Skipped animation when switching between preview modal tabs refs https://github.com/TryGhost/Admin/commit/2c9998be6944c6b58c6381c939a4e1459e2ccc7a - animation should only show when opening the preview modal directly from the editor --- ghost/admin/app/components/editor-labs/modals/preview.hbs | 8 ++++---- ghost/admin/app/components/editor-labs/modals/preview.js | 6 ++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ghost/admin/app/components/editor-labs/modals/preview.hbs b/ghost/admin/app/components/editor-labs/modals/preview.hbs index 04cc8e3d06..e035c97a43 100644 --- a/ghost/admin/app/components/editor-labs/modals/preview.hbs +++ b/ghost/admin/app/components/editor-labs/modals/preview.hbs @@ -53,14 +53,14 @@ {{#if (eq this.tab "browser")}} {{/if}} {{#if (and (eq this.tab "mobile"))}} {{/if}} @@ -69,7 +69,7 @@ {{/if}} {{/unless}} @@ -77,7 +77,7 @@ {{#if (eq this.tab "social")}} {{/if}} {{/if}} diff --git a/ghost/admin/app/components/editor-labs/modals/preview.js b/ghost/admin/app/components/editor-labs/modals/preview.js index 4d2e4bd071..2e49972251 100644 --- a/ghost/admin/app/components/editor-labs/modals/preview.js +++ b/ghost/admin/app/components/editor-labs/modals/preview.js @@ -15,15 +15,21 @@ export default class EditorPostPreviewModal extends Component { }; @tracked tab = this.args.data.currentTab || 'browser'; + @tracked isChangingTab = false; constructor() { super(...arguments); this.saveFirstTask.perform(); } + get skipAnimation() { + return this.args.data.skipAnimation || this.isChangingTab; + } + @action changeTab(tab) { this.tab = tab; + this.isChangingTab = true; this.args.data.changeTab?.(tab); }