|
|
@ -22,7 +22,7 @@ MIME_TYPES =
|
|
|
|
ajax.defaults =
|
|
|
|
ajax.defaults =
|
|
|
|
async: true
|
|
|
|
async: true
|
|
|
|
dataType: 'json'
|
|
|
|
dataType: 'json'
|
|
|
|
timeout: 30000
|
|
|
|
timeout: 30
|
|
|
|
type: 'GET'
|
|
|
|
type: 'GET'
|
|
|
|
# contentType
|
|
|
|
# contentType
|
|
|
|
# context
|
|
|
|
# context
|
|
|
@ -53,7 +53,7 @@ serializeParams = (params) ->
|
|
|
|
applyCallbacks = (xhr, options) ->
|
|
|
|
applyCallbacks = (xhr, options) ->
|
|
|
|
return unless options.async
|
|
|
|
return unless options.async
|
|
|
|
|
|
|
|
|
|
|
|
xhr.timer = setTimeout onTimeout.bind(undefined, xhr, options), options.timeout
|
|
|
|
xhr.timer = setTimeout onTimeout.bind(undefined, xhr, options), options.timeout * 1000
|
|
|
|
xhr.onreadystatechange = ->
|
|
|
|
xhr.onreadystatechange = ->
|
|
|
|
if xhr.readyState is 4
|
|
|
|
if xhr.readyState is 4
|
|
|
|
clearTimeout(xhr.timer)
|
|
|
|
clearTimeout(xhr.timer)
|
|
|
|