Sha256: 8f62ca39c8d22847e5b431643937e43a6c0a6307143ff2fdd936139620953b30

Contents?: true

Size: 838 Bytes

Versions: 1

Compression:

Stored size: 838 Bytes

Contents

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

  $("body.email_conversations-show a.preview").click(function(e) {
    // logg(e, 'clicked')

    if ($(this).data('expanded')) {
      $(this).parent().find(".expand").html('')
      $(this).parent().find(".my-actions").addClass('hide')
      $(this).data('expanded', false)
      return
    }

    const action_path = "/api/email_messages/" + $(this).data('id')

    $.ajax({
      url: action_path,
      type: 'GET',
      data: {
        jwt_token: $( $("#Config")[0] ).data('jwt-token'),
      },
      success: e => {
        $(this).parent().find(".expand").html(e.item.part_html)
        $(this).parent().find(".my-actions").removeClass('hide')
        $(this).data('expanded', true)
      },
      error: e => {
        logg((e||{}).responseText, 'cannot get email_message')
      },
    })
  })

})

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ish_manager-0.1.8.363 app/assets/javascripts/ish_manager/email_conversations.js