From cdab7b77db5394b4f5e9afb6d723d7612fe4ba73 Mon Sep 17 00:00:00 2001
From: Zvonimir Rudinski
Looking for a fully commited developer who can digitalize your business?
class Section extends HTMLElement {
container: HTMLElement;
+ isMain: boolean;
constructor() {
super();
@@ -39,6 +41,7 @@ const { title, hasBorder } = Astro.props;
}
this.container = container;
+ this.isMain = this.dataset.hasOwnProperty("ismain");
const trigger = this.querySelector("h2");
@@ -71,13 +74,17 @@ const { title, hasBorder } = Astro.props;
extend(section: Element, container: HTMLElement) {
container.style.maxHeight = "1000vh";
section.classList.add("open");
- sessionStorage.setItem("openSection", this.id);
+ if (this.isMain) {
+ sessionStorage.setItem("openSection", this.id);
+ }
}
collapse(section: Element, container: HTMLElement) {
container.style.maxHeight = "0";
section.classList.remove("open");
- sessionStorage.removeItem("openSection");
+ if (this.isMain) {
+ sessionStorage.removeItem("openSection");
+ }
}
}
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 133b823..6bdcff5 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -25,7 +25,7 @@ import { projects } from "../projects";
$ Zvonimir Rudinski / Home
-
Here are some of the projects I have worked on. You can find more
information about a project by clicking on its name.
@@ -75,7 +75,7 @@ import { projects } from "../projects";
>blog
-