Skip to content

Commit

Permalink
Fix dropdown menu javascriot
Browse files Browse the repository at this point in the history
  • Loading branch information
nyamsprod committed Jun 29, 2024
1 parent d820764 commit c19e6d5
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
2 changes: 1 addition & 1 deletion docs/_data/manifest.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"docs.css": "/styles.0001.css",
"docs.js": "/scripts.0001.js"
"docs.js": "/scripts.0002.js"
}
18 changes: 12 additions & 6 deletions docs/scripts.0001.js → docs/scripts.0002.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,19 @@
}, false);
snippet.appendChild(link);
});
})();

window.addEventListener('DOMContentLoaded', (e) => {

const dropDownList = document.getElementById('packageDropdownList');
const dropDownButton = document.getElementById('packageDropdown');

document.getElementById('packageDropdown').addEventListener('click', (e) => {
dropDownButton.addEventListener('click', () => {
dropDownList.classList.toggle('hidden');
})
})
});

document.addEventListener('click', (event) => {
if (!dropDownButton.contains(event.target) && !dropDownList.contains(event.target)) {
dropDownList.classList.add('hidden');
}
});
})();


0 comments on commit c19e6d5

Please sign in to comment.