This commit is contained in:
Warunee Tamkoo 2023-09-08 15:56:45 +07:00
parent fa245db14d
commit 7091d109aa

View file

@ -18,7 +18,7 @@ import type {
import {
menuList,
tabList,
tabListPlacement,
// tabListPlacement,
} from "../interface/request/main/main";
const { setVerticalScrollPosition, getVerticalScrollPosition } = scroll;
@ -289,32 +289,32 @@ const updateScrollPlacement = (position: number) => {
position = document.documentElement.scrollTop || document.body.scrollTop;
}
let last;
for (const i in tabListPlacement) {
const section = tabListPlacement[i];
const item = document.getElementById(section.tag);
// let last;
// for (const i in tabListPlacement) {
// const section = tabListPlacement[i];
// const item = document.getElementById(section.tag);
if (item === null) {
continue;
}
// if (item === null) {
// continue;
// }
if (item.offsetTop >= position + 100) {
if (last === void 0) {
last = section.tag;
}
break;
} else {
last = section.tag;
}
}
// if (item.offsetTop >= position + 100) {
// if (last === void 0) {
// last = section.tag;
// }
// break;
// } else {
// last = section.tag;
// }
// }
if (last !== void 0) {
changeTab(last);
const tocEl = document.getElementById("tab--" + last);
if (tocEl) {
tocEl.scrollIntoView({ block: "nearest" });
}
}
// if (last !== void 0) {
// changeTab(last);
// const tocEl = document.getElementById("tab--" + last);
// if (tocEl) {
// tocEl.scrollIntoView({ block: "nearest" });
// }
// }
};
const activeBtnPlacement = () => {
@ -830,7 +830,7 @@ if (keycloak.tokenParsed != null) {
</q-drawer>
<!-- drawer page placement2/detail/:id -->
<q-drawer
<!-- <q-drawer
side="right"
class="bg-grey-2"
show-if-above
@ -865,7 +865,7 @@ if (keycloak.tokenParsed != null) {
</q-item>
</q-list>
</q-scroll-area>
</q-drawer>
</q-drawer> -->
<!-- drawer -->
<q-page-container class="bg-grey-2">