diff --git a/components/app/Shortcuts.vue b/components/app/Shortcuts.vue index 0b8fd803d..0dc91afdc 100644 --- a/components/app/Shortcuts.vue +++ b/components/app/Shortcuts.vue @@ -23,6 +23,7 @@
diff --git a/layouts/default.vue b/layouts/default.vue index ab6e89221..5bc5bfdcd 100644 --- a/layouts/default.vue +++ b/layouts/default.vue @@ -59,6 +59,23 @@ import { hookKeybindingsListener } from "~/helpers/keybindings" import { defineActionHandler } from "~/helpers/actions" import useWindowSize from "~/helpers/utils/useWindowSize" +function appLayout() { + const rightSidebar = useSetting("RIGHT_SIDEBAR") + const windowInnerWidth = useWindowSize() + + // Initially apply + onBeforeMount(() => { + if (windowInnerWidth.x.value < 768) rightSidebar.value = false + }) + + // Listen for updates + watch(windowInnerWidth.x, () => + windowInnerWidth.x.value >= 768 + ? (rightSidebar.value = true) + : (rightSidebar.value = false) + ) +} + function updateThemes() { const { $colorMode } = useContext() as any @@ -113,6 +130,8 @@ function defineJumpActions() { export default defineComponent({ components: { Splitpanes, Pane }, setup() { + appLayout() + hookKeybindingsListener() defineJumpActions()