PageSourceSearch

https://careersingovernment.com/templates/CareersinGov/assets/new_js/search-history.js

js careersingovernment.com collected 2026-09-25 15:04:51 UTC 809 bytes, 29 lines download raw bytes

1// For RECENT SEARCH HISTORY widget (Seachbar dropdown)
2// It checks if the <ul> is empty (no li inside = no history) and if so, removes the widget
3function toggleEmptySearchSections() {
4  const $wrapper = $(".cig__recent-history-wrapper");
5  let hasVisibleSection = false;
6
7  $wrapper.children("div").each(function () {
8    const $section = $(this);
9    const $list = $section.find("ul");
10
11    if ($list.length && $list.children("li").length > 0) {
12      $section.show();
13      hasVisibleSection = true;
14    } else {
15      $section.hide();
16    }
17  });
18
19  // Remove padding if ALL sections are empty
20  if (!hasVisibleSection) {
21    $wrapper.css("padding", "0");
22  } else {
23    $wrapper.css("padding", "");
24  }
25}
26
27$(document).ready(function () {
28  toggleEmptySearchSections();
29});

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.