PageSourceSearch

https://www.sandburg.edu/js/custom.js

js sandburg.edu collected 2026-09-24 09:52:49 UTC 2,874 bytes, 91 lines download raw bytes

1const navCollapse = document.getElementById('navbar')
2const subCollapse = document.getElementById('main-navigation')
3const searchCollapse = document.getElementById('search')
4navCollapse.addEventListener('shown.bs.collapse', event => {
5    event.stopPropagation();
6    document.getElementById('overlay').classList.add('show');
7})
8navCollapse.addEventListener('hidden.bs.collapse', event => {
9    event.stopPropagation();
10    document.getElementById('overlay').classList.remove('show');
11})
12subCollapse.addEventListener('hidden.bs.collapse', event => {
13    event.stopPropagation();
14})
15searchCollapse.addEventListener('shown.bs.collapse', event => {
16    event.stopPropagation();
17    document.getElementById('overlay').classList.add('show');
18})
19searchCollapse.addEventListener('hidden.bs.collapse', event => {
20    event.stopPropagation();
21    document.getElementById('overlay').classList.remove('show');
22})
23
24const img = document.querySelector('.hh-news img');
25if (img) {
26    img.style.width = img.getAttribute('width')+'px';
27    img.style.height = img.getAttribute('height')+'px';
28}
29
30window.addEventListener('resize', (event) => {
31    handleOverflow(event);
32})
33window.addEventListener('load', (event) => {
34    handleOverflow(event);
35})
36function mobileMenus() {
37    const subMenuHeadings = document.querySelectorAll('.menu .title');
38    Array.from(subMenuHeadings).forEach(function(subMenuHeading){
39        subMenuHeading.addEventListener('click', function(event){
40            toggleShowOnNextSilbling(event.target.nextElementSibling);
41            event.stopPropagation();
42        });
43    });
44}
45
46function toggleShowOnNextSilbling(element) {
47    if(element.classList.contains('show')){
48        element.classList.remove('show');
49    }
50    else {
51        element.classList.add('show');
52    }
53    if (element.nextElementSibling) {
54        toggleShowOnNextSilbling(element.nextElementSibling)
55    }
56}
57
58mobileMenus();
59
60
61const navButton = document.getElementById('subnav-toggle');
62const overflowMenu = document.getElementById('overflow-nav');
63if (navButton) {
64    navButton.onclick = (event) => {
65        overflowMenu.classList.toggle('show');
66    }
67}
68function checkOverflow(el) {
69    let isOverflowing = el.clientWidth < el.scrollWidth
70    return isOverflowing;
71}
72function handleOverflow() {
73  const nav = document.getElementById('sub-nav');
74  const over = document.getElementById('overflow-nav');
75  const button = document.getElementById('subnav-toggle');
76
77  if (!nav || !over || !button) return;
78
79  button.classList.remove('show');
80  over.classList.remove('show');
81
82  while (over.firstChild) {
83    nav.appendChild(over.firstChild);
84  }
85
86  while (checkOverflow(nav) && nav.lastElementChild) {
87    const item = nav.lastElementChild;
88    over.prepend(item);
89    button.classList.add('show');
90  }
91}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.