codecombat/app/core/contact.coffee

27 lines
743 B
CoffeeScript
Raw Normal View History

module.exports = {
sendContactMessage: (contactMessageObject, modal) ->
# deprecated
modal?.find('.sending-indicator').show()
return $.post '/contact', contactMessageObject, (response) ->
return unless modal
modal.find('.sending-indicator').hide()
modal.find('#contact-message').val('Thanks!')
_.delay ->
modal.find('#contact-message').val('')
modal.modal 'hide'
, 1000
send: (options={}) ->
options.type = 'POST'
options.url = '/contact'
$.ajax(options)
2016-06-30 18:32:58 -04:00
sendParentSignupInstructions: (parentEmail) ->
jqxhr = $.ajax('/contact/send-parent-signup-instructions', {
method: 'POST'
data: {parentEmail}
})
return new Promise(jqxhr.then)
}