<commit_before>$(function() {
  $( document ).on('turbolinks:render, turbolinks:load', function() {
    show_rejection();

    $('#volunteer_state').on('change', ({target}) => {
      show_rejection(target);
    });

    $('.volunteer-active-checkbox-changes').on('change', ({target}) => {
      const data = $(target).data();
      if(target.checked) {
        changeStateSelectToActiveVolunteer(data.state);
        hideFormRegions(data.hide);
      } else {
        changeStateSelectToNonActiveVolunteer(data.state);
        showFormRegions(data.hide);
      }
    });
  });
});

const hideFormRegions = (hide) => {
  hide.forEach(cssClass => $(`.${cssClass}`).hide());
}

const showFormRegions = (hide) => {
  hide.forEach(cssClass => $('.' + cssClass).show());
}
<commit_msg>fix rejection text display and hide<commit_after>$(function() {
  $( document ).on('turbolinks:render, turbolinks:load', function() {
    show_rejection();

    $('#volunteer_acceptance_rejected').on('change', ({target}) => {
      show_rejection(target);
    });

    $('.volunteer-active-checkbox-changes').on('change', ({target}) => {
      const data = $(target).data();
      if(target.checked) {
        changeStateSelectToActiveVolunteer(data.state);
        hideFormRegions(data.hide);
      } else {
        changeStateSelectToNonActiveVolunteer(data.state);
        showFormRegions(data.hide);
      }
    });
  });
});

const hideFormRegions = (hide) => {
  hide.forEach(cssClass => $(`.${cssClass}`).hide());
}

const showFormRegions = (hide) => {
  hide.forEach(cssClass => $('.' + cssClass).show());
}

{'fraction_non_alphanumeric': 0.19799498746867167, 'fraction_numerical': 0.0, 'mean_word_length': 3.589080459770115, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '4879642', 'n_tokens_mistral': 515, 'n_tokens_neox': 511, 'n_words': 65}