collapse recent pages by default

This commit is contained in:
ThatOneCalculator 2022-12-05 22:50:59 -08:00
parent a29ffde755
commit ac5368749c
3 changed files with 11 additions and 8 deletions

View file

@ -8,7 +8,8 @@
<template v-else><i class="ph-caret-down-bold ph-lg"></i></template>
</button>
</header>
<transition :name="$store.state.animation ? 'folder-toggle' : ''"
<transition
:name="$store.state.animation ? 'folder-toggle' : ''"
@enter="enter"
@after-enter="afterEnter"
@leave="leave"
@ -27,17 +28,18 @@ import tinycolor from 'tinycolor2';
const localStoragePrefix = 'ui:folder:';
// eslint-disable-next-line import/no-default-export
export default defineComponent({
props: {
expanded: {
type: Boolean,
required: false,
default: true
default: true,
},
persistKey: {
type: String,
required: false,
default: null
default: null,
},
},
data() {
@ -51,7 +53,7 @@ export default defineComponent({
if (this.persistKey) {
localStorage.setItem(localStoragePrefix + this.persistKey, this.showBody ? 't' : 'f');
}
}
},
},
mounted() {
function getParentBg(el: Element | null): string {
@ -91,7 +93,7 @@ export default defineComponent({
afterLeave(el) {
el.style.height = null;
},
}
},
});
</script>

View file

@ -55,7 +55,7 @@
</div> -->
</div>
<MkAd :prefer="['horizontal', 'horizontal-big']"/>
<MkContainer :max-height="300" :foldable="true" class="other">
<MkContainer :max-height="300" :foldable="true" :expanded="false" class="other">
<template #header><i class="ph-clock-bold ph-lg"></i> {{ i18n.ts.recentPosts }}</template>
<MkPagination v-slot="{items}" :pagination="otherPostsPagination">
<MkPagePreview v-for="page in items" :key="page.id" :page="page" class="_gap"/>

View file

@ -9,7 +9,8 @@
<script lang="ts" setup>
import { defineAsyncComponent } from 'vue';
import XColumn from './column.vue';
import { updateColumn , Column } from './deck-store';
import { updateColumn } from './deck-store';
import type { Column } from './deck-store';
import XNotifications from '@/components/MkNotifications.vue';
import * as os from '@/os';
import { i18n } from '@/i18n';
@ -23,7 +24,7 @@ const emit = defineEmits<{
(ev: 'parent-focus', direction: 'up' | 'down' | 'left' | 'right'): void;
}>();
function func() {
function func(): void {
os.popup(defineAsyncComponent(() => import('@/components/MkNotificationSettingWindow.vue')), {
includingTypes: props.column.includingTypes,
}, {