Sha256: 896d4747bea1172c2be52c193f46c01de5c586bfc8a0f101857ff65581c7b436

Contents?: true

Size: 907 Bytes

Versions: 2

Compression:

Stored size: 907 Bytes

Contents

AppRouter = {
  new_email_context_with: (slug) => `/manager/email_contexts/new_with_template/${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

2 entries across 2 versions & 1 rubygems

Version Path
ish_manager-0.1.8.357 app/assets/javascripts/ish_manager/email_contexts.js
ish_manager-0.1.8.356 app/assets/javascripts/ish_manager/email_contexts.js