This commit is contained in:
Mauve
2026-10-26 09:29:53 +08:00
parent 2be9f0a786
commit 34a02a487d
36 changed files with 587 additions and 177 deletions
+9 -9
View File
@@ -10,7 +10,7 @@ import {
getCSS,
ElementStyleUtil,
} from "../_utils/index";
import { CookieComponent } from "./_CookieComponent";
//import { CookieComponent } from "./_CookieComponent";
export interface ScrollOptions {
saveState?: boolean;
@@ -167,14 +167,14 @@ class ScrollComponent {
private setupState = () => {
if (this.getOption("save-state") === true && this.id) {
const cookie = CookieComponent.get(this.id + "st");
if (cookie) {
const pos = parseInt(cookie);
// const cookie = CookieComponent.get(this.id + "st");
// if (cookie) {
// const pos = parseInt(cookie);
if (pos > 0) {
this.element.scrollTop = pos;
}
}
// if (pos > 0) {
// this.element.scrollTop = pos;
// }
// }
}
};
@@ -188,7 +188,7 @@ class ScrollComponent {
private scrollHandler = () => {
const cookieId = this.id + "st";
CookieComponent.set(cookieId, this.element.scrollTop, {});
//CookieComponent.set(cookieId, this.element.scrollTop, {});
};
private destroyScrollHandler = () => {