MCPcopy Create free account
hub / github.com/CodeClash-ai/CodeClash / initializeFoldouts

Function initializeFoldouts

codeclash/viewer/static/js/app.js:60–87  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59// Enhanced foldout behavior
60function initializeFoldouts() {
61 // Add smooth animations to details elements
62 const detailsElements = document.querySelectorAll("details");
63
64 detailsElements.forEach((details) => {
65 const summary = details.querySelector("summary");
66
67 // Add click analytics/feedback
68 summary.addEventListener("click", function (e) {
69 // Small delay to allow default behavior
70 setTimeout(() => {
71 // Scroll into view if needed
72 if (details.open) {
73 const rect = details.getBoundingClientRect();
74 const isInViewport =
75 rect.top >= 0 && rect.bottom <= window.innerHeight;
76
77 if (!isInViewport) {
78 details.scrollIntoView({
79 behavior: "smooth",
80 block: "nearest",
81 });
82 }
83 }
84 }, 100);
85 });
86 });
87}
88
89// Keyboard shortcuts
90function initializeKeyboardShortcuts() {

Callers 1

app.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected