codecombat/app/lib/contact.coffee
2014-01-03 10:32:13 -08:00

16 lines
498 B
CoffeeScript

module.exports.sendContactMessage = (contactMessageObject, modal) ->
modal.find('.sending-indicator').show()
jqxhr = $.post '/contact',
email: contactMessageObject.email
message: contactMessageObject.message
,
(response) ->
console.log "Got contact response:", response
modal.find('.sending-indicator').hide()
modal.find('#contact-message').val("Thanks!")
_.delay ->
modal.find('#contact-message').val("")
modal.modal 'hide'
, 1000