From 9d076b17c804de5551cfb146bbfb8e6b8429ed37 Mon Sep 17 00:00:00 2001 From: Jashwanth-rit <158207370+Jashwanth-rit@users.noreply.github.com> Date: Wed, 18 Sep 2024 20:13:45 +0530 Subject: [PATCH] fix: #322 --- postdoc.config.js | 1 + src/includes/navbar.ejs | 54 ++++++++++++++++++++++++++++++----------- 2 files changed, 41 insertions(+), 14 deletions(-) diff --git a/postdoc.config.js b/postdoc.config.js index 173dbc5b..09b4ba45 100644 --- a/postdoc.config.js +++ b/postdoc.config.js @@ -40,6 +40,7 @@ export default { layouts: ['**/example-*.ejs'] }, + apidocs: { source: API_DOCS_FOLDER, layout: 'api/index.ejs', diff --git a/src/includes/navbar.ejs b/src/includes/navbar.ejs index 0d925897..da9bd7e9 100644 --- a/src/includes/navbar.ejs +++ b/src/includes/navbar.ejs @@ -2,6 +2,28 @@ function activeLink(urlPart) { return page.url.includes(urlPart) ? 'active' : ''; } + + + // Get the button and menu elements + const releaseButton = document.getElementById('releaseVersionButton'); + const releaseMenu = document.getElementById('releaseVersionMenu'); + const arrowIcon = document.getElementById('arrowIcon').querySelector('path'); + + // Add a click event listener to the button + releaseButton.addEventListener('click', function() { + // Toggle menu visibility + if (releaseMenu.style.display === 'none') { + releaseMenu.style.display = 'block'; + // Change the arrow to point upwards + arrowIcon.setAttribute('d', 'M1.41421 7.01562H10.5858C11.4767 7.01562 11.9229 5.93848 11.2929 5.30852L6.70711 0.72273C6.31658 0.33221 5.68342 0.33221 5.29289 0.72273L0.707105 5.30852C0.0771403 5.93848 0.523309 7.01562 1.41421 7.01562Z'); // Up arrow + } else { + releaseMenu.style.display = 'none'; + // Change the arrow back to pointing downwards + arrowIcon.setAttribute('d', 'M10.5858 0.984375H1.41421C0.523309 0.984375 0.0771403 2.06152 0.707105 2.69148L5.29289 7.27727C5.68342 7.66779 6.31658 7.66779 6.70711 7.27727L11.2929 2.69148C11.9229 2.06152 11.4767 0.984375 10.5858 0.984375Z'); // Down arrow + } + }); + + %>