Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions src/components/layouts/BaseSideBarLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
>
</a>
</div>
<div v-if="sandboxConfig !== ''" class="level-item">
<div v-if="isSandbox" class="level-item">
<div id="sandbox-feedback" v-bind:class="{'notification is-warning px-5 has-text-centered': sandboxConfig === SandboxMode.Public,
'notification is-info px-5 has-text-centered': sandboxConfig === SandboxMode.Coordinator}">
<p class="title is-size-5">Sandbox </p>
Expand Down Expand Up @@ -119,8 +119,8 @@ import UserStatusMenu from "@/components/layouts/menus/UserStatusMenu.vue";
showMenu?: boolean;

mounted () {
// IF the screen is narrow and DeltaBreed is in private-sandbox or coordinator-sandbox modes, THEN default the sidebar to "hidden".
store.commit(SHOW_SIDEBAR_MOBILE, (window.matchMedia("(min-width: 700px)").matches && (this.sandboxConfig === '1' || this.sandboxConfig === SandboxMode.Coordinator)));
// Default to Showing the sidebar menu if the width is wider than 700px or if it not in Sandbox mode, Otherwise default to hiding the sidebar.
store.commit(SHOW_SIDEBAR_MOBILE, (window.matchMedia("(min-width: 700px)").matches || !this.isSandbox));
}
toggleSidebar() {
store.commit(SHOW_SIDEBAR_MOBILE, !this.showSidebarMobile);
Expand All @@ -129,6 +129,10 @@ import UserStatusMenu from "@/components/layouts/menus/UserStatusMenu.vue";
get sandboxConfig() {
return process.env.VUE_APP_SANDBOX;
}

get isSandbox() {
return (this.sandboxConfig===SandboxMode.Coordinator || this.sandboxConfig===SandboxMode.Public || this.sandboxConfig==='1');
}
}

</script>