Skip to content
Snippets Groups Projects
Commit 019b7bca authored by Harm Kube's avatar Harm Kube
Browse files

Animation when opening sub-sections

parent 80ffb89d
No related branches found
No related tags found
No related merge requests found
...@@ -310,10 +310,11 @@ ...@@ -310,10 +310,11 @@
.neighbor-content-links { .neighbor-content-links {
padding: 5px; padding: 5px;
display: none; display: none;
overflow: hidden;
background-color: #ffffff; background-color: #ffffff;
flex-direction: column; flex-direction: column;
overflow-x: auto; height: 0;
transition: height 0.25s ease-out;
overflow: hidden;
} }
.link-neighbor { .link-neighbor {
......
...@@ -64,7 +64,8 @@ class NodeNeighborOverlay { ...@@ -64,7 +64,8 @@ class NodeNeighborOverlay {
} }
}); });
const slideDown = elem => elem.style.height = `${elem.scrollHeight}px`;
const slideUp = elem => elem.style.height = '0';
const colors = const colors =
this.type === "link" this.type === "link"
...@@ -105,11 +106,13 @@ class NodeNeighborOverlay { ...@@ -105,11 +106,13 @@ class NodeNeighborOverlay {
this.tabContentPages[cls] = collTabContent; this.tabContentPages[cls] = collTabContent;
collTab.addEventListener("click", function() { collTab.addEventListener("click", function() {
if(collTabContent.style.display === "flex") { if(collTabContent.style.display === "flex") {
slideUp(collTabContent);
collTabContent.style.display = "none"; collTabContent.style.display = "none";
openMarkerTabs.innerText = '+'; openMarkerTabs.innerText = '+';
} else { } else {
collTabContent.style.display = "flex"; collTabContent.style.display = "flex";
openMarkerTabs.innerText = '-'; openMarkerTabs.innerText = '-';
slideDown(collTabContent);
} }
}); });
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment