<commit_before>// Cool Helpers
import * as dom from '../helpers/dom'
import * as classy from '../helpers/classy'
import * as aria from '../helpers/aria'
import * as event from '../helpers/event'
import bus from '../helpers/bus'

// ┌──────────┐
// │ Dropdown │
// └──────────┘
// show and hide dropdown menus
function dropdown () {
  var toggles = dom.findElements('.js-dropdown-toggle');
  var dropdowns = dom.findElements('.js-dropdown');

  bus.on('dropdown:toggle', toggleDropdown)
  bus.on('dropdown:close', closeAllDropdowns)
  bus.on('keyboard:escape', closeAllDropdowns)
  bus.on('dropdown:bind', bindDropdowns)

  function closeAllDropdowns (options) {
    event.remove(document.body, event.click(), closeAllDropdowns);
    dropdowns.forEach(function (dropdown) {
      classy.remove(dropdown, 'is-active');
    });
  }

  function toggleDropdown (options) {
    if (!options) return
    classy.toggle(options.node, 'is-active');
    if(classy.has(options.node, 'is-active')) {
      event.add(document.body, event.click(), closeAllDropdowns);
    }
  }

  function bindDropdowns (options) {
    if (!options) {
      toggles.forEach(function (toggle) {
        event.add(toggle, event.click(), toggleClick)
      })
    }
  }

  function toggleClick (e) {
    event.preventDefault(e);
    event.stopPropagation(e);
    var dropdown = dom.closest('js-dropdown', e.target);
    bus.emit('dropdown:toggle', {node: dropdown})
  }

  bus.emit('dropdown:bind')
};

export default dropdown<commit_msg>remove stubbed out if statement<commit_after>// Cool Helpers
import * as dom from '../helpers/dom'
import * as classy from '../helpers/classy'
import * as aria from '../helpers/aria'
import * as event from '../helpers/event'
import bus from '../helpers/bus'

// ┌──────────┐
// │ Dropdown │
// └──────────┘
// show and hide dropdown menus
function dropdown () {
  var toggles = dom.findElements('.js-dropdown-toggle');
  var dropdowns = dom.findElements('.js-dropdown');

  bus.on('dropdown:toggle', toggleDropdown)
  bus.on('dropdown:close', closeAllDropdowns)
  bus.on('keyboard:escape', closeAllDropdowns)
  bus.on('dropdown:bind', bindDropdowns)

  function closeAllDropdowns (options) {
    event.remove(document.body, event.click(), closeAllDropdowns);
    dropdowns.forEach(function (dropdown) {
      classy.remove(dropdown, 'is-active');
    });
  }

  function toggleDropdown (options) {
    if (!options) return
    classy.toggle(options.node, 'is-active');
    if(classy.has(options.node, 'is-active')) {
      event.add(document.body, event.click(), closeAllDropdowns);
    }
  }

  function bindDropdowns (options) {
    toggles.forEach(function (toggle) {
      event.add(toggle, event.click(), toggleClick)
    })
  }

  function toggleClick (e) {
    event.preventDefault(e);
    event.stopPropagation(e);
    var dropdown = dom.closest('js-dropdown', e.target);
    bus.emit('dropdown:toggle', {node: dropdown})
  }

  bus.emit('dropdown:bind')
};

export default dropdown
{'fraction_non_alphanumeric': 0.16867067468269872, 'fraction_numerical': 0.0, 'mean_word_length': 3.792, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '635825', 'n_tokens_mistral': 980, 'n_tokens_neox': 957, 'n_words': 205}