diff options
| author | shpuld <shp@cock.li> | 2019-01-31 17:00:31 +0200 |
|---|---|---|
| committer | shpuld <shp@cock.li> | 2019-01-31 17:00:31 +0200 |
| commit | 476bf0afe1c890b0f08587b3942981c8c591c7be (patch) | |
| tree | fcadf92a94d8e310355f640a69a92010eee002cb /src/components/tab_switcher | |
| parent | fbe7af3d56e4e6e168208a511bd7cd4e4e4e7a40 (diff) | |
Fix media timeline attachments being small by adding an option to not render background tabs in tab switcher
Diffstat (limited to 'src/components/tab_switcher')
| -rw-r--r-- | src/components/tab_switcher/tab_switcher.js (renamed from src/components/tab_switcher/tab_switcher.jsx) | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/components/tab_switcher/tab_switcher.jsx b/src/components/tab_switcher/tab_switcher.js index 9038733c..f9c3f927 100644 --- a/src/components/tab_switcher/tab_switcher.jsx +++ b/src/components/tab_switcher/tab_switcher.js @@ -4,6 +4,7 @@ import './tab_switcher.scss' export default Vue.component('tab-switcher', { name: 'TabSwitcher', + props: ['renderOnlyFocused'], data () { return { active: this.$slots.default.findIndex(_ => _.tag) @@ -44,11 +45,12 @@ export default Vue.component('tab-switcher', { const contents = this.$slots.default.map((slot, index) => { if (!slot.tag) return const active = index === this.active - return ( - <div class={active ? 'active' : 'hidden'}> - {slot} - </div> - ) + if (this.renderOnlyFocused) { + return active + ? <div class="active">{slot}</div> + : <div class="hidden"></div> + } + return <div class={active ? 'active' : 'hidden' }>{slot}</div> }) return ( |
