Page MenuHomeSealhub

index.ts
No OneTemporary

index.ts

export * from "./controllers.js";
(function enableScrollPreservation() {
/* https://github.com/hotwired/turbo/issues/37#issuecomment-1422200868 */
let scrollTop = 0;
let shouldPreserveScroll = false;
document.addEventListener("turbo:click", function (event) {
if ((event.target as HTMLDivElement).hasAttribute("data-turbo-preserve-scroll")) {
shouldPreserveScroll = true;
} else {
shouldPreserveScroll = false;
}
});
document.addEventListener("turbo:visit", function () {
if (shouldPreserveScroll) {
scrollTop = document.documentElement.scrollTop;
} else {
scrollTop = 0;
}
});
addEventListener("turbo:visit", () => {
/* eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any */
(window as any).Turbo.navigator.currentVisit.scrolled = true;
document.documentElement.scrollTop = scrollTop;
});
})();

File Metadata

Mime Type
text/plain
Expires
Thu, Jul 3, 03:02 (1 d, 18 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
798351
Default Alt Text
index.ts (892 B)

Event Timeline