Hackerrank new templates in sandbox. updated a bunch of williams-sonoma stuff. GSU backup.

This commit is contained in:
Norm Rasmussen
2024-10-24 16:50:02 -04:00
parent 1335c4c29b
commit 3626ead591
42 changed files with 839 additions and 265 deletions

View File

@ -21,3 +21,43 @@
{% include "courses_catalog" %}
</main>
{% include "footer" %}
<script>
function clickDropdownMenu() {
const dropdownMenu = document.getElementsByClassName('dropdown-menu')[0]
const event = new MouseEvent('click', {
view: window,
bubbles: true,
cancelable: true
});
dropdownMenu.dispatchEvent(event);
console.log('clicked')
}
window.addEventListener('DOMContentLoaded', () => {
const choices = document.querySelectorAll('.choices__item.choices__item--choice.choices__item--selectable')
const targetNode = document.getElementsByClassName('choices__list')[2];
const config = { attributes: true, childList: true, subtree: true };
const callback = (mutationList, observer) => {
var updated_choices = document.querySelectorAll('.choices__item.choices__item--choice.choices__item--selectable')
for (const mutation of mutationList) {
Array.from(updated_choices).forEach((choice) => {
choice.addEventListener("mousedown", clickDropdownMenu);
})
}
};
const observer = new MutationObserver(callback);
Array.from(choices).forEach((choice) => {
choice.addEventListener("mousedown", clickDropdownMenu);
})
observer.observe(targetNode, config);
});
</script>