mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-15 01:33:54 +00:00
wrking on scroll up at last item
This commit is contained in:
parent
a082fce977
commit
949a7feb97
@ -204,7 +204,19 @@ export default defineComponent({
|
||||
function scrollToGraph(e: any) {
|
||||
document?.getElementById(`tabitem${e}`)?.scrollIntoView();
|
||||
}
|
||||
|
||||
function debounce(func: any, wait: number, immediate: boolean) {
|
||||
let timeout: any;
|
||||
return function () {
|
||||
let context = this,
|
||||
args = arguments;
|
||||
clearTimeout(timeout);
|
||||
timeout = setTimeout(function () {
|
||||
timeout = null;
|
||||
if (!immediate) func.apply(context, args);
|
||||
}, wait);
|
||||
if (immediate && !timeout) func.apply(context, args);
|
||||
};
|
||||
}
|
||||
function observeItems(kill = false) {
|
||||
const observer = new IntersectionObserver((entries) => {
|
||||
entries.forEach(
|
||||
@ -226,8 +238,8 @@ export default defineComponent({
|
||||
});
|
||||
if (kill) {
|
||||
document.querySelectorAll(".tabitem").forEach((element) => {
|
||||
observer.unobserve(element);
|
||||
});
|
||||
observer.unobserve(element);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -318,9 +330,12 @@ export default defineComponent({
|
||||
}
|
||||
);
|
||||
onMounted(() => {
|
||||
window.addEventListener("scroll", (e) => {
|
||||
console.log(e);
|
||||
});
|
||||
tabRef?.value["parentElement"]?.classList?.toggle("item");
|
||||
if (dashboardStore.fullView) {
|
||||
console.log("Tab Osbercve:", tabObserveContainer);
|
||||
// console.log("Tab Osbercve:", tabObserveContainer);
|
||||
}
|
||||
});
|
||||
onBeforeUnmount(() => {
|
||||
@ -372,6 +387,10 @@ export default defineComponent({
|
||||
.scroll-snap-container::-webkit-scrollbar {
|
||||
display: none;
|
||||
}
|
||||
.scroll-snap-container {
|
||||
-ms-overflow-style: none;
|
||||
scrollbar-width: none;
|
||||
}
|
||||
.tabitem {
|
||||
scroll-snap-align: start;
|
||||
height: 100%;
|
||||
|
Loading…
Reference in New Issue
Block a user