Sha256: 4e42aa3d2c1129cb59b616b0ddeab7f69bc81a88f24dc0fa43a6693083b09e5f

Contents?: true

Size: 898 Bytes

Versions: 27

Compression:

Stored size: 898 Bytes

Contents

AppRouter = {
  new_email_context_with: (slug) => `/manager/email_contexts/new_with/${slug}`
}

$(document).ready(() => {

  if ($(".email-contexts--form").length) {
    $("#ish_email_context_email_template_id").on('change', (ev) => {
      const val = ev.target.value
      window.location.href = AppRouter.new_email_context_with(val)
    })

    $("#ish_email_context_type").on('change', (ev) => {
      const val = ev.target.value
      if (val == 'TYPE_CAMPAIGN') {
        $(".email-contexts--form .TYPE_SINGLE").css('display', 'none')
      } else {
        $(".email-contexts--form .TYPE_SINGLE").css('display', 'block')
      }
    })
    // on page load:
    if ($("#ish_email_context_type").val() == 'TYPE_CAMPAIGN') {
      $(".email-contexts--form .TYPE_SINGLE").css('display', 'none')
    } else {
      $(".email-contexts--form .TYPE_SINGLE").css('display', 'block')
    }

  }

})

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
ish_manager-0.1.8.335 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.334 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.333 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.332 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.331 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.330 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.329 app/assets/javascripts/ish_manager/email_contexts.js