diff options
| author | Henry Jameson <me@hjkos.com> | 2020-05-28 21:26:33 +0300 |
|---|---|---|
| committer | Henry Jameson <me@hjkos.com> | 2020-05-28 21:28:01 +0300 |
| commit | 9a20a9093287b1835d635398ea900e5dc2ca3484 (patch) | |
| tree | 48c37262b1f79048a234cbdb03d3a7ce79579802 /src/components/tab_switcher | |
| parent | 5ffcddd3b9b4b6600e4e51066b9410d7e852df11 (diff) | |
fixed the remaining issues
Diffstat (limited to 'src/components/tab_switcher')
| -rw-r--r-- | src/components/tab_switcher/tab_switcher.js | 15 | ||||
| -rw-r--r-- | src/components/tab_switcher/tab_switcher.scss | 11 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.js index 616f1a19..7891cb78 100644 --- a/src/components/tab_switcher/tab_switcher.js +++ b/src/components/tab_switcher/tab_switcher.js @@ -113,23 +113,20 @@ export default Vue.component('tab-switcher', { if (slot.data.attrs.fullHeight) { classes.push('full-height') } - const newSlot = ( + const renderSlot = (!this.renderOnlyFocused || active) + ? slot + : '' + + return ( <div class={classes}> { this.sideTabBar ? <h1 class="mobile-label">{slot.data.attrs.label}</h1> : '' } - {slot} + {renderSlot} </div> ) - - if (this.renderOnlyFocused) { - return active - ? <div class={classes.join(' ')}>{newSlot}</div> - : <div class={classes.join(' ')}></div> - } - return <div class={classes.join(' ')}>{newSlot}</div> }) return ( diff --git a/src/components/tab_switcher/tab_switcher.scss b/src/components/tab_switcher/tab_switcher.scss index db58f4cd..2a364731 100644 --- a/src/components/tab_switcher/tab_switcher.scss +++ b/src/components/tab_switcher/tab_switcher.scss @@ -125,8 +125,9 @@ border-bottom-right-radius: 0; padding-left: 1em; padding-right: calc(1em + 200px); - margin-right: calc(1em - 200px); + margin-right: -200px; margin-left: 1em; + @media all and (max-width: 800px) { padding-left: .25em; padding-right: calc(.25em + 200px); @@ -147,6 +148,14 @@ .hidden { display: none; } + .full-height { + height: 100%; + display: flex; + flex-direction: column; + > *:not(.mobile-label) { + flex: 1; + } + } &.scrollable-tabs { overflow-y: auto; |
