Add forceRender property to tabs (#15699)

closes TryGhost/Team#2163
- `forceRender` property adds ability to render content of tabs in
advance (even if tab wasn't selected)
This commit is contained in:
Elena Baidakova 2022-10-26 21:03:29 +04:00 committed by GitHub
parent 28b11e6fed
commit f1e476d6af
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 2 deletions

View File

@ -41,7 +41,7 @@
</div>
</GhCanvasHeader>
<Tabs::Tabs class="gh-tabs-analytics" as |tabs|>
<Tabs::Tabs class="gh-tabs-analytics" @forceRender={{true}} as |tabs|>
{{#if this.post.hasBeenEmailed}}
<tabs.tab>
<h3>Sent</h3>

View File

@ -5,7 +5,7 @@
aria-labelledby="{{this.tabId}}"
class="tab-panel {{if this.isSelectedTab "tab-panel-selected" }}"
>
{{#if this.isSelectedTab}}
{{#if (or this.isSelectedTab @forceRender)}}
{{yield}}
{{/if}}
</div>

View File

@ -24,6 +24,7 @@
selectedIndex=this.selectedIndex
index=this.addPanelIndex
tabIds=this.tabIds
forceRender=@forceRender
)
)
}}

View File

@ -1621,7 +1621,12 @@ a.gh-post-list-cta.stats.is-hovered:hover > * {
box-shadow: inset 0 -1px 0 #eceef0;
}
.gh-tabs-analytics .tab-panel {
display: none;
}
.gh-tabs-analytics .tab-panel-selected {
display: block;
padding: 12px 26px 0;
/* help to hide shadow from selected tab */
opacity: 0.99999;