<commit_before>moj.Modules.CaseCreation = {
  $deliveryMethod       : $('#delivery-method'),

  $deliveryMethodEmail  : $('#case_delivery_method_sent_by_email'),
  $deliveryMethodPost   : $('#case_delivery_method_sent_by_post'),

  $deliveryMethodFields : $('#delivery-method-fields'),

  init: function () {
    var self = this;

    self.showHideDeliveryMethodFields();

    //Bind events
    self.$deliveryMethod.on('change', ':radio', function(){

      self.showHideDeliveryMethodFields();

    });
  },

  showHideDeliveryMethodFields: function (){
    if (this.$deliveryMethod.find(':radio').is(':checked')){

      this.$deliveryMethodFields.show();

      if (this.$deliveryMethodEmail.is('checked')) {
        $('#case_message').closest('.form-group').show();
      } else {
        $('#case_message').closest('.form-group').hide();
      }

      if (this.$deliveryMethodPost.is('checked')) {
        $('.dropzone').closest('.grid-row').show();
      } else {
        $('.dropzone').closest('.grid-row').show();
      }

    } else {

      this.$deliveryMethodFields.hide();

      $('#case_message').closest('.form-group').hide();

      $('.dropzone').closest('.grid-row').hide();

    }
  }
};
<commit_msg>CT-1391 Fix js on foi new case page<commit_after>moj.Modules.CaseCreation = {
  $deliveryMethod       : $('#delivery-method'),

  $deliveryMethodEmail  : $('#case_foi_delivery_method_sent_by_email'),
  $deliveryMethodPost   : $('#case_foi_delivery_method_sent_by_post'),

  $deliveryMethodFields : $('#delivery-method-fields'),

  init: function () {
    var self = this;

    self.showHideDeliveryMethodFields();

    //Bind events
    self.$deliveryMethod.on('change', ':radio', function(){

      self.showHideDeliveryMethodFields();

    });
  },

  showHideDeliveryMethodFields: function (){
    if (this.$deliveryMethod.find(':radio').is(':checked')){

      this.$deliveryMethodFields.show();

      if (this.$deliveryMethodEmail.is(':checked')) {
        $('#case_foi_message').closest('.form-group').show();
      } else {
        $('#case_foi_message').closest('.form-group').hide();
      }

      if (this.$deliveryMethodPost.is(':checked')) {
        $('.dropzone').closest('.grid-row').show();
      } else {
        $('.dropzone').closest('.grid-row').hide();
      }

    } else {

      this.$deliveryMethodFields.hide();

      $('#case_message').closest('.form-group').hide();

      $('.dropzone').closest('.grid-row').hide();

    }
  }
};

{'fraction_non_alphanumeric': 0.20104754230459307, 'fraction_numerical': 0.0016116035455278, 'mean_word_length': 3.2884283246977546, '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': '4144316', 'n_tokens_mistral': 801, 'n_tokens_neox': 772, 'n_words': 87}