diff --git a/src/components/settings_modal/settings_modal_user_content.js b/src/components/settings_modal/settings_modal_user_content.js index c770fbe04..7a05adbb1 100644 --- a/src/components/settings_modal/settings_modal_user_content.js +++ b/src/components/settings_modal/settings_modal_user_content.js @@ -75,7 +75,8 @@ const SettingsModalContent = { }, data () { return { - navCollapsed: false + navCollapsed: false, + childCollapsed: false } }, methods: { @@ -96,10 +97,14 @@ const SettingsModalContent = { }, nestedTooBig () { this.navCollapsed = false + this.childCollapsed = this.$refs.generalTab.getNavMode() + console.log(this.navCollapsed, this.childCollapsed) this.$refs.tabSwitcher.showNav() }, nestedTooSmall () { this.navCollapsed = true + this.childCollapsed = this.$refs.generalTab.getNavMode() + console.log(this.navCollapsed, this.childCollapsed) this.$refs.tabSwitcher.hideNav() } }, diff --git a/src/components/settings_modal/settings_modal_user_content.vue b/src/components/settings_modal/settings_modal_user_content.vue index de89cecc8..b992796ef 100644 --- a/src/components/settings_modal/settings_modal_user_content.vue +++ b/src/components/settings_modal/settings_modal_user_content.vue @@ -3,6 +3,7 @@ ref="tabSwitcher" class="settings_tab-switcher" :scrollable-tabs="true" + :child-collapsed="childCollapsed" :body-scroll-lock="bodyLock" >
diff --git a/src/components/settings_modal/tabs/general_tab.js b/src/components/settings_modal/tabs/general_tab.js index 28a4eac40..897999bba 100644 --- a/src/components/settings_modal/tabs/general_tab.js +++ b/src/components/settings_modal/tabs/general_tab.js @@ -136,6 +136,15 @@ const GeneralTab = { this.$store.dispatch('settingsSaved', { error }) }) }, + tooSmall () { + this.$emit('tooSmall') + }, + tooBig () { + this.$emit('tooBig') + }, + getNavMode () { + return this.$refs.tabSwitcher.getNavMode() + }, clearAssetCache () { this.clearCache(cacheKey) }, diff --git a/src/components/settings_modal/tabs/general_tab.vue b/src/components/settings_modal/tabs/general_tab.vue index de88add2d..2476a8d28 100644 --- a/src/components/settings_modal/tabs/general_tab.vue +++ b/src/components/settings_modal/tabs/general_tab.vue @@ -4,8 +4,8 @@ ref="tabSwitcher" class="settings_tab-switcher" :parent-collapsed="parentCollapsed" - @too-small="() => $emit('tooSmall')" - @too-big="() => $emit('tooBig')" + @too-small="tooSmall" + @too-big="tooBig" >
= tabContentWidth){ - if (this.parentCollapsed) { + if (!this.navMode) { this.$emit('tooBig') } else { this.showNav() @@ -122,12 +128,16 @@ export default { this.onSwitch.call(null, this.slots()[index].key) } this.active = index + this.navSide = 'content' }, showNav () { this.navMode = false }, hideNav () { this.navMode = true + }, + getNavMode () { + return this.navMode } }, render () { @@ -173,8 +183,13 @@ export default { ? slot : '' + const headerClasses = ['tab-content-label'] + if (this.childCollapsed) { + headerClasses.push('-hidden') + } const header = ( -

+

+ {props.label}

) @@ -192,7 +207,11 @@ export default { const rootClasses = ['vertical-tab-switcher'] if (this.navMode) { rootClasses.push('-nav-mode') - rootClasses.push('-nav-content') + if (this.navSide === 'content') { + rootClasses.push('-nav-content') + } else { + rootClasses.push('-nav-tabs') + } } return ( diff --git a/src/components/tab_switcher/vertical_tab_switcher.scss b/src/components/tab_switcher/vertical_tab_switcher.scss index 480f90f1a..2a6e1cc6a 100644 --- a/src/components/tab_switcher/vertical_tab_switcher.scss +++ b/src/components/tab_switcher/vertical_tab_switcher.scss @@ -85,6 +85,10 @@ > .tab-content-wrapper { > .tab-content-label { display: block; + + &.-hidden { + display: none; + } } } }