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