fix toggle sidebar

This commit is contained in:
Jonas Heinrich 2020-11-17 13:32:15 +01:00
parent 95311ebcff
commit 336e51bd1d
2 changed files with 15 additions and 5 deletions

View File

@ -36,7 +36,8 @@
</AppContent> </AppContent>
<Sidebar <Sidebar
:show-sidebar="showSidebar" :show-sidebar="showSidebar"
:sidebar-station="sidebarStation" /> :sidebar-station="sidebarStation"
@toggleSidebar="toggleSidebar" />
</Content> </Content>
</template> </template>
@ -332,9 +333,13 @@ export default {
}) })
}, },
toggleSidebar(station) { toggleSidebar(station = null) {
this.showSidebar = true if (station) {
this.sidebarStation = station this.showSidebar = true
this.sidebarStation = station
} else {
this.showSidebar = false
}
}, },
}, },
} }

View File

@ -5,7 +5,7 @@
:subtitle="stationTags" :subtitle="stationTags"
:background="sidebarStation.favicon" :background="sidebarStation.favicon"
class="has-preview" class="has-preview"
@close="showSidebar=false"> @close="toggleSidebar">
<div class="configBox"> <div class="configBox">
<span class="icon icon-link" /> <span class="icon icon-link" />
<span class="title"> <span class="title">
@ -90,6 +90,11 @@ export default {
return '' return ''
}, },
}, },
methods: {
toggleSidebar(station) {
this.$emit('toggleSidebar')
},
},
} }
</script> </script>