aboutsummaryrefslogtreecommitdiff
path: root/src/components/tab_switcher/tab_switcher.js
diff options
context:
space:
mode:
authorHenry Jameson <me@hjkos.com>2020-05-24 02:06:55 +0300
committerHenry Jameson <me@hjkos.com>2020-05-24 02:06:55 +0300
commitab74cd497205d5964db38d56f6f70fb727c60d78 (patch)
tree6a474957da1c5dbc3f9d7e0bbfca574249d6ba4a /src/components/tab_switcher/tab_switcher.js
parentbcebec478e43b3851e85c94335940e8fc7546cc8 (diff)
Multiple fixes for CSS, added proper auth checking
Diffstat (limited to 'src/components/tab_switcher/tab_switcher.js')
-rw-r--r--src/components/tab_switcher/tab_switcher.js12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/components/tab_switcher/tab_switcher.js b/src/components/tab_switcher/tab_switcher.js
index 97791de3..a54b474f 100644
--- a/src/components/tab_switcher/tab_switcher.js
+++ b/src/components/tab_switcher/tab_switcher.js
@@ -69,7 +69,6 @@ export default Vue.component('tab-switcher', {
if (!slot.tag) return
const classesTab = ['tab']
const classesWrapper = ['tab-wrapper']
-
if (this.activeIndex === index) {
classesTab.push('active')
classesWrapper.push('active')
@@ -101,12 +100,17 @@ export default Vue.component('tab-switcher', {
const contents = this.$slots.default.map((slot, index) => {
if (!slot.tag) return
const active = this.activeIndex === index
+ const classes = [ active ? 'active' : 'hidden' ]
+ if (slot.data.attrs.fullHeight) {
+ classes.push('full-height')
+ }
+
if (this.renderOnlyFocused) {
return active
- ? <div class="active">{slot}</div>
- : <div class="hidden"></div>
+ ? <div class={classes.join(' ')}>{slot}</div>
+ : <div class={classes.join(' ')}></div>
}
- return <div class={active ? 'active' : 'hidden' }>{slot}</div>
+ return <div class={classes.join(' ')}>{slot}</div>
})
return (