fix(frontend): fix broken styles
This commit is contained in:
parent
260d35e2f0
commit
0471e457fe
|
@ -109,12 +109,6 @@ export const ROLE_POLICIES = [
|
||||||
'canImportUserLists',
|
'canImportUserLists',
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
// なんか動かない
|
|
||||||
//export const CURRENT_STICKY_TOP = Symbol('CURRENT_STICKY_TOP');
|
|
||||||
//export const CURRENT_STICKY_BOTTOM = Symbol('CURRENT_STICKY_BOTTOM');
|
|
||||||
export const CURRENT_STICKY_TOP = 'CURRENT_STICKY_TOP';
|
|
||||||
export const CURRENT_STICKY_BOTTOM = 'CURRENT_STICKY_BOTTOM';
|
|
||||||
|
|
||||||
export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg';
|
export const DEFAULT_SERVER_ERROR_IMAGE_URL = 'https://xn--931a.moe/assets/error.jpg';
|
||||||
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg';
|
export const DEFAULT_NOT_FOUND_IMAGE_URL = 'https://xn--931a.moe/assets/not-found.jpg';
|
||||||
export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg';
|
export const DEFAULT_INFO_IMAGE_URL = 'https://xn--931a.moe/assets/info.jpg';
|
||||||
|
|
|
@ -23,8 +23,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { onMounted, onUnmounted, provide, inject, ref, watch, useTemplateRef } from 'vue';
|
import { onMounted, onUnmounted, provide, inject, ref, watch, useTemplateRef } from 'vue';
|
||||||
import { CURRENT_STICKY_BOTTOM, CURRENT_STICKY_TOP } from '@@/js/const.js';
|
import { DI } from '@/di.js';
|
||||||
import type { Ref } from 'vue';
|
|
||||||
|
|
||||||
const rootEl = useTemplateRef('rootEl');
|
const rootEl = useTemplateRef('rootEl');
|
||||||
const headerEl = useTemplateRef('headerEl');
|
const headerEl = useTemplateRef('headerEl');
|
||||||
|
@ -32,13 +31,13 @@ const footerEl = useTemplateRef('footerEl');
|
||||||
|
|
||||||
const headerHeight = ref<string | undefined>();
|
const headerHeight = ref<string | undefined>();
|
||||||
const childStickyTop = ref(0);
|
const childStickyTop = ref(0);
|
||||||
const parentStickyTop = inject<Ref<number>>(CURRENT_STICKY_TOP, ref(0));
|
const parentStickyTop = inject(DI.currentStickyTop, ref(0));
|
||||||
provide(CURRENT_STICKY_TOP, childStickyTop);
|
provide(DI.currentStickyTop, childStickyTop);
|
||||||
|
|
||||||
const footerHeight = ref<string | undefined>();
|
const footerHeight = ref<string | undefined>();
|
||||||
const childStickyBottom = ref(0);
|
const childStickyBottom = ref(0);
|
||||||
const parentStickyBottom = inject<Ref<number>>(CURRENT_STICKY_BOTTOM, ref(0));
|
const parentStickyBottom = inject(DI.currentStickyBottom, ref(0));
|
||||||
provide(CURRENT_STICKY_BOTTOM, childStickyBottom);
|
provide(DI.currentStickyBottom, childStickyBottom);
|
||||||
|
|
||||||
const calc = () => {
|
const calc = () => {
|
||||||
// コンポーネントが表示されてないけどKeepAliveで残ってる場合などは null になる
|
// コンポーネントが表示されてないけどKeepAliveで残ってる場合などは null になる
|
||||||
|
|
|
@ -12,4 +12,6 @@ export const DI = {
|
||||||
mock: Symbol() as InjectionKey<boolean>,
|
mock: Symbol() as InjectionKey<boolean>,
|
||||||
pageMetadata: Symbol() as InjectionKey<Ref<Record<string, any>>>,
|
pageMetadata: Symbol() as InjectionKey<Ref<Record<string, any>>>,
|
||||||
viewId: Symbol() as InjectionKey<string>,
|
viewId: Symbol() as InjectionKey<string>,
|
||||||
|
currentStickyTop: Symbol() as InjectionKey<Ref<number>>,
|
||||||
|
currentStickyBottom: Symbol() as InjectionKey<Ref<number>>,
|
||||||
};
|
};
|
||||||
|
|
|
@ -179,14 +179,14 @@ rt {
|
||||||
|
|
||||||
._pageScrollable {
|
._pageScrollable {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: clip;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
._pageScrollableReversed {
|
._pageScrollableReversed {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
overflow: clip;
|
||||||
overflow-y: scroll;
|
overflow-y: scroll;
|
||||||
overscroll-behavior: contain;
|
overscroll-behavior: contain;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
|
@ -97,7 +97,6 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { defineAsyncComponent, provide, onMounted, computed, ref, watch, useTemplateRef } from 'vue';
|
import { defineAsyncComponent, provide, onMounted, computed, ref, watch, useTemplateRef } from 'vue';
|
||||||
import { instanceName } from '@@/js/config.js';
|
import { instanceName } from '@@/js/config.js';
|
||||||
import { CURRENT_STICKY_BOTTOM } from '@@/js/const.js';
|
|
||||||
import { isLink } from '@@/js/is-link.js';
|
import { isLink } from '@@/js/is-link.js';
|
||||||
import XCommon from './_common_/common.vue';
|
import XCommon from './_common_/common.vue';
|
||||||
import type { Ref } from 'vue';
|
import type { Ref } from 'vue';
|
||||||
|
@ -200,16 +199,13 @@ const onContextmenu = (ev) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const navFooterHeight = ref(0);
|
const navFooterHeight = ref(0);
|
||||||
provide<Ref<number>>(CURRENT_STICKY_BOTTOM, navFooterHeight);
|
|
||||||
|
|
||||||
watch(navFooter, () => {
|
watch(navFooter, () => {
|
||||||
if (navFooter.value) {
|
if (navFooter.value) {
|
||||||
navFooterHeight.value = navFooter.value.offsetHeight;
|
navFooterHeight.value = navFooter.value.offsetHeight;
|
||||||
window.document.body.style.setProperty('--MI-stickyBottom', `${navFooterHeight.value}px`);
|
|
||||||
window.document.body.style.setProperty('--MI-minBottomSpacing', 'var(--MI-minBottomSpacingMobile)');
|
window.document.body.style.setProperty('--MI-minBottomSpacing', 'var(--MI-minBottomSpacingMobile)');
|
||||||
} else {
|
} else {
|
||||||
navFooterHeight.value = 0;
|
navFooterHeight.value = 0;
|
||||||
window.document.body.style.setProperty('--MI-stickyBottom', '0px');
|
|
||||||
window.document.body.style.setProperty('--MI-minBottomSpacing', '0px');
|
window.document.body.style.setProperty('--MI-minBottomSpacing', '0px');
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
|
|
Loading…
Reference in New Issue