Created
June 18, 2015 14:56
-
-
Save mfyance/07a70247ecb65db1a589 to your computer and use it in GitHub Desktop.
Ajax - Call Javascript - Coffee
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn = | |
servicioHorarioLaboral : (servicio) -> | |
ajax = $.ajax | |
type: 'GET' | |
contentType: 'application/json; charset=utf-8' | |
dataType: 'json' | |
url: st.url.horarios | |
data: {} | |
timeout: 30000 | |
beforeSend: (xhr) -> | |
Sb.trigger 'tableLoading' , dom.content_horarios | |
return | |
.fail (jqXHR, textStatus, errorThrown) -> | |
log "Solicitud fallado: " + textStatus | |
return | |
servicio.call(this, ajax) | |
return | |
cargarHorariosLaborales: -> | |
fn.servicioHorarioLaboral (ajax) -> | |
ajax.done (data) -> | |
template = dom.tmp_horarios.html() | |
info = Mustache.render template, data | |
dom.content_horarios.html info | |
return | |
ajax.always -> | |
fn.eliminarHorario() | |
fn.validarEnvioHorario() | |
fn.validarCambioHorario() | |
return | |
return | |
return |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment