INNER CODE UNIT · JavaScript

toggleFilterDropdown

mitre-attack/attack-website · attack-search/src/index.js:49

const toggleFilterDropdown = function (dropdownKey) {
  if (searchService) {
    searchService.toggleFilterDropdown(dropdownKey);
    return;
  }

  const previousDropdownKey = openFilterDropdownKey;
  const isOpening = previousDropdownKey !== dropdownKey;

  if (previousDropdownKey) setFilterDropdownOpenState(previousDropdownKey, false);
  openFilterDropdownKey = isOpening ? dropdownKey : null;
  if (openFilterDropdownKey) setFilterDropdownOpenState(openFilterDropdownKey, true);
};

const closeFilterDropdowns = function () {
  if (searchService?.closeFilterDropdowns?.()) return true;
  if (!openFilterDropdownKey) return false;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…