Add cit.nih

This commit is contained in:
Scott Williams 2025-02-26 17:28:32 -05:00
commit cba854ff64
147 changed files with 43354 additions and 0 deletions

View file

@ -0,0 +1,13 @@
const accordionComponent = document.querySelector('.accordion');
accordionComponent?.addEventListener('click', (event) => {
accordion(event);
});
function accordion() {
const btn = event.target.closest('[accordion-trigger]');
const expanded = btn.getAttribute('aria-expanded') === 'true';
const target = btn.parentNode.nextElementSibling;
btn.setAttribute('aria-expanded', !expanded);
target.hidden = expanded;
}

View file

@ -0,0 +1,69 @@
/**
* @file
* Global utilities.
*
*/
(function (Drupal) {
'use strict';
Drupal.behaviors.bootstrap_barrio = {
attach: function (context, settings) {
var position = window.scrollY;
window.addEventListener('scroll', function() {
if (window.scrollY > 50) {
document.querySelector('body').classList.add("scrolled");
}
else {
document.querySelector('body').classList.remove("scrolled");
}
var scroll = window.scrollY;
if (scroll > position) {
document.querySelector('body').classList.add("scrolldown");
document.querySelector('body').classList.remove("scrollup");
} else {
document.querySelector('body').classList.add("scrollup");
document.querySelector('body').classList.remove("scrolldown");
}
position = scroll;
});
document.addEventListener('click', function (event) {
// If the clicked element doesn't have the right selector, bail
if (!event.target.matches('.dropdown-item a.dropdown-toggle')) return;
// Don't follow the link
event.preventDefault();
toggle(event.target.next('ul'));
event.stopPropagation();
}, false);
// Toggle element visibility
var toggle = function (elem) {
// If the element is visible, hide it
if (window.getComputedStyle(elem).display === 'block') {
hide(elem);
return;
}
// Otherwise, show it
show(elem);
};
var show = function (elem) {
elem.style.display = 'block';
};
var hide = function (elem) {
elem.style.display = 'none';
};
}
};
})(Drupal);

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,18 @@
/**
* @file
* Global utilities.
*
*/
(function($, Drupal) {
'use strict';
Drupal.behaviors.customer_portal_theme = {
attach: function(context, settings) {
// Custom code here
}
};
})(jQuery, Drupal);

View file

@ -0,0 +1,16 @@
const modals = document.querySelectorAll("[data-modal]");
modals?.forEach(function (trigger) {
trigger.addEventListener("click", function (event) {
event.preventDefault();
const modal = document.getElementById(trigger.dataset.modal);
modal.classList.add("open");
const exits = modal.querySelectorAll(".modal-exit");
exits.forEach(function (exit) {
exit.addEventListener("click", function (event) {
event.preventDefault();
modal.classList.remove("open");
});
});
});
});

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long