CURAS / app /static /app.js
stevafernandes's picture
Multi-select areas, colour-coded area tags, Creighton students only, titles removed, Creighton blue
4f5fdec verified
Raw History Blame Contribute Delete
1.12 kB
// Small progressive enhancements. Every page works without this file.
(function () {
"use strict";
// Admin sign-in: the session cookie is not sent when the site is embedded in
// another site's frame (for example the Space page on huggingface.co), so
// point the notice at the direct address and show it.
var frameNote = document.getElementById("frame-note");
if (frameNote && window.top !== window.self) {
var link = frameNote.querySelector("a");
if (link) { link.href = window.location.href; link.target = "_top"; }
frameNote.classList.remove("hidden");
}
// Area-of-study dropdown: close it when clicking elsewhere or pressing Escape.
var dropdown = document.getElementById("area-dropdown");
if (dropdown) {
document.addEventListener("click", function (event) {
if (dropdown.open && !dropdown.contains(event.target)) { dropdown.open = false; }
});
document.addEventListener("keydown", function (event) {
if (event.key === "Escape" && dropdown.open) {
dropdown.open = false;
dropdown.querySelector("summary").focus();
}
});
}
})();