merge: upstream
This commit is contained in:
commit
5db583a3eb
701 changed files with 50809 additions and 13660 deletions
|
|
@ -13,7 +13,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { onMounted, onUnmounted } from 'vue';
|
||||
import { onMounted, onUnmounted, shallowRef, ref } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
|
||||
const props = withDefaults(defineProps<{
|
||||
|
|
@ -22,13 +22,13 @@ const props = withDefaults(defineProps<{
|
|||
maxHeight: 200,
|
||||
});
|
||||
|
||||
let content = $shallowRef<HTMLElement>();
|
||||
let omitted = $ref(false);
|
||||
let ignoreOmit = $ref(false);
|
||||
const content = shallowRef<HTMLElement>();
|
||||
const omitted = ref(false);
|
||||
const ignoreOmit = ref(false);
|
||||
|
||||
const calcOmit = () => {
|
||||
if (omitted || ignoreOmit) return;
|
||||
omitted = content.offsetHeight > props.maxHeight;
|
||||
if (omitted.value || ignoreOmit.value) return;
|
||||
omitted.value = content.value.offsetHeight > props.maxHeight;
|
||||
};
|
||||
|
||||
const omitObserver = new ResizeObserver((entries, observer) => {
|
||||
|
|
@ -37,7 +37,7 @@ const omitObserver = new ResizeObserver((entries, observer) => {
|
|||
|
||||
onMounted(() => {
|
||||
calcOmit();
|
||||
omitObserver.observe(content);
|
||||
omitObserver.observe(content.value);
|
||||
});
|
||||
|
||||
onUnmounted(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue