update carbon-mini
This commit is contained in:
Vendored
+16
@@ -1,3 +1,4 @@
|
||||
// TABS
|
||||
document.querySelector("main").addEventListener("scroll", () => {
|
||||
const links = document.querySelectorAll(".tab-link");
|
||||
links.forEach((element) => element.removeAttribute("active"));
|
||||
@@ -8,3 +9,18 @@ document.querySelector("main").addEventListener("scroll", () => {
|
||||
|
||||
if (links[currentPage]) links[currentPage].setAttribute("active", "");
|
||||
});
|
||||
|
||||
// SERVICE WORKER
|
||||
async function registerServiceWorker() {
|
||||
if ("serviceWorker" in navigator) {
|
||||
try {
|
||||
await navigator.serviceWorker.register("/sw.js", {
|
||||
scope: "/",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(`Could not install service worker: ${error}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
registerServiceWorker();
|
||||
|
||||
Reference in New Issue
Block a user