mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-01 02:41:39 -05:00
Skipped animation when switching between preview modal tabs
refs 2c9998be69
- animation should only show when opening the preview modal directly from the editor
This commit is contained in:
parent
2c9998be69
commit
802a3c6187
2 changed files with 10 additions and 4 deletions
|
@ -53,14 +53,14 @@
|
|||
{{#if (eq this.tab "browser")}}
|
||||
<EditorLabs::Modals::Preview::Browser
|
||||
@post={{@data.publishOptions.post}}
|
||||
@skipAnimation={{@data.skipAnimation}}
|
||||
@skipAnimation={{this.skipAnimation}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
{{#if (and (eq this.tab "mobile"))}}
|
||||
<EditorLabs::Modals::Preview::Mobile
|
||||
@post={{@data.publishOptions.post}}
|
||||
@skipAnimation={{@data.skipAnimation}}
|
||||
@skipAnimation={{this.skipAnimation}}
|
||||
/>
|
||||
{{/if}}
|
||||
|
||||
|
@ -69,7 +69,7 @@
|
|||
<EditorLabs::Modals::Preview::Email
|
||||
@post={{@data.publishOptions.post}}
|
||||
@newsletter={{@data.publishOptions.newsletter}}
|
||||
@skipAnimation={{@data.skipAnimation}}
|
||||
@skipAnimation={{this.skipAnimation}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/unless}}
|
||||
|
@ -77,7 +77,7 @@
|
|||
{{#if (eq this.tab "social")}}
|
||||
<EditorLabs::Modals::Preview::Social
|
||||
@post={{@data.publishOptions.post}}
|
||||
@skipAnimation={{@data.skipAnimation}}
|
||||
@skipAnimation={{this.skipAnimation}}
|
||||
/>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue