refactor: hide right sidebars by default on mobile devices
This commit is contained in:
@@ -23,6 +23,7 @@
|
|||||||
<div class="flex flex-col my-4 mx-6">
|
<div class="flex flex-col my-4 mx-6">
|
||||||
<input
|
<input
|
||||||
v-model="filterText"
|
v-model="filterText"
|
||||||
|
v-focus
|
||||||
type="search"
|
type="search"
|
||||||
autocomplete="off"
|
autocomplete="off"
|
||||||
class="
|
class="
|
||||||
@@ -36,7 +37,6 @@
|
|||||||
focus-visible:border-divider
|
focus-visible:border-divider
|
||||||
"
|
"
|
||||||
:placeholder="$t('action.search')"
|
:placeholder="$t('action.search')"
|
||||||
v-focus
|
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -59,6 +59,23 @@ import { hookKeybindingsListener } from "~/helpers/keybindings"
|
|||||||
import { defineActionHandler } from "~/helpers/actions"
|
import { defineActionHandler } from "~/helpers/actions"
|
||||||
import useWindowSize from "~/helpers/utils/useWindowSize"
|
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() {
|
function updateThemes() {
|
||||||
const { $colorMode } = useContext() as any
|
const { $colorMode } = useContext() as any
|
||||||
|
|
||||||
@@ -113,6 +130,8 @@ function defineJumpActions() {
|
|||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
components: { Splitpanes, Pane },
|
components: { Splitpanes, Pane },
|
||||||
setup() {
|
setup() {
|
||||||
|
appLayout()
|
||||||
|
|
||||||
hookKeybindingsListener()
|
hookKeybindingsListener()
|
||||||
|
|
||||||
defineJumpActions()
|
defineJumpActions()
|
||||||
|
|||||||
Reference in New Issue
Block a user