2016-05-09 18:16:54 -04:00
|
|
|
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)
|
2016-05-09 18:16:54 -04:00
|
|
|
}
|