Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added accordion #18790

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/current/_includes/accordion.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<span class="accordion-toggle" data-target="arm-tbody" style="cursor: pointer;margin-left: 25px;">
<span class="accordion-icon" style="position: relative;bottom: 3px;font-size: 14px;margin-bottom: 10px;font-weight: bold">&#8964;</span>
</span>
1 change: 1 addition & 0 deletions src/current/_layouts/default.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
</script>
{% endif %}
<script src="{{ 'js/tocRightScrollHighlight.js' | relative_url }}" defer></script>
<script src="{{ 'js/accordion.js' | relative_url }}" ></script>
{% include_cached google_tag_manager.html %}
{% include_cached google_remarketing.html %}
{% if page.twitter == true %}
Expand Down
24 changes: 24 additions & 0 deletions src/current/js/accordion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
document.addEventListener("DOMContentLoaded", function() {
console.log('JavaScript loaded');
const accordionToggles = document.querySelectorAll('.accordion-toggle');
console.log('Accordion toggles found:', accordionToggles.length);
accordionToggles.forEach(function(accordionToggle) {
accordionToggle.addEventListener('click', function() {
console.log('Accordion clicked');
const targetId = accordionToggle.getAttribute('data-target');
console.log('Target ID:', targetId);
const tbody = document.getElementById(targetId);
if (tbody) {
if (tbody.style.display === 'none' || tbody.style.display === '') {
tbody.style.display = 'table-row-group'; // Show <tbody>
console.log('Showing tbody');
} else {
tbody.style.display = 'none'; // Hide <tbody>
console.log('Hiding tbody');
}
} else {
console.log('No tbody found with ID:', targetId);
}
});
});
});
4 changes: 2 additions & 2 deletions src/current/releases/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ As of 2024, CockroachDB is released under a staged delivery process. New release
<td>Date</td>
<td>Intel 64-bit Downloads</td>
{% if v_linux_arm == true %}
<td>ARM 64-bit Downloads</td>
<td>ARM 64-bit Downloads{% include accordion.html %}</td>
{% endif %}
</tr>
</thead>
<tbody>
<tbody id="arm-tbody">
{% for r in releases %}
{% assign current_patch_string = '' %}
{% assign current_patch = nil %}
Expand Down
Loading