<commit_before>import panel from '../templates/panel/panel';
import tooltip from '../templates/tooltip/tooltip';
import State from '../state';

export function selectChange() {
  const index = this.options[this.selectedIndex].value;
  if (State.settings.report === 'detailed') {
    panel(Number(index));
  } else {
    tooltip(undefined, Number(index));
  }
}

export const removeSelectListener = () => {
  const el = State.shadowRoot.getElementById('gene-select');
  if (el) {
    el.removeEventListener('change', selectChange);
  }
};

export const addSelectListener = (results) => {
  if (results.length > 1) {
    const el = State.shadowRoot.getElementById('gene-select');
    el.addEventListener('change', selectChange);
  }
};<commit_msg>Update select.js<commit_after>import panel from '../templates/panel/panel';
import tooltip from '../templates/tooltip/tooltip';
import State from '../state';

export function selectChange() {
  const index = this.options[this.selectedIndex].value;
  if (State.settings.report === 'detailed') {
    panel(Number(index));
  } else {
    tooltip(undefined, Number(index));
  }
}

export const removeSelectListener = () => {
  const el = State.shadowRoot.getElementById('gene-select');
  if (el) {
    el.removeEventListener('change', selectChange);
  }
};

export const addSelectListener = (results) => {
  if (results && results.length > 1) {
    const el = State.shadowRoot.getElementById('gene-select');
    el.addEventListener('change', selectChange);
  }
};
{'fraction_non_alphanumeric': 0.1589095744680851, 'fraction_numerical': 0.0013297872340425532, 'mean_word_length': 4.355871886120997, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '521980', 'n_tokens_mistral': 436, 'n_tokens_neox': 427, 'n_words': 96}